@webex/calling 3.12.0 → 3.13.0-next.10
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/README.md +1 -1
- package/dist/CallHistory/CallHistory.js +1 -1
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +2 -1
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallQueue/CallQueue.js +1322 -0
- package/dist/CallQueue/CallQueue.js.map +1 -0
- package/dist/CallQueue/CallQueue.test.js +3321 -0
- package/dist/CallQueue/CallQueue.test.js.map +1 -0
- package/dist/CallQueue/constants.js +65 -0
- package/dist/CallQueue/constants.js.map +1 -0
- package/dist/CallQueue/types.js +4 -0
- package/dist/CallQueue/types.js.map +1 -0
- package/dist/CallQueue/utils.js +370 -0
- package/dist/CallQueue/utils.js.map +1 -0
- package/dist/CallQueue/utils.test.js +548 -0
- package/dist/CallQueue/utils.test.js.map +1 -0
- 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 +748 -0
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +824 -0
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -0
- package/dist/CallRecording/callRecordingFixtures.js +266 -0
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -0
- package/dist/CallRecording/constants.js +35 -0
- package/dist/CallRecording/constants.js.map +1 -0
- package/dist/CallRecording/types.js +142 -0
- package/dist/CallRecording/types.js.map +1 -0
- package/dist/CallRecording/userhub.js +117 -0
- package/dist/CallRecording/userhub.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 +469 -233
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +736 -179
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +3 -1
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +12 -2
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +645 -458
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +928 -498
- 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 +34 -4
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +27 -3
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +102 -17
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +971 -506
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +1037 -116
- 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 +39 -11
- package/dist/Events/types.js.map +1 -1
- package/dist/Metrics/index.js +63 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/Metrics/index.test.js +357 -1
- package/dist/Metrics/index.test.js.map +1 -1
- package/dist/Metrics/types.js +19 -1
- package/dist/Metrics/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +10 -10
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +40 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/api.js +95 -0
- package/dist/api.js.map +1 -1
- package/dist/common/Utils.js +259 -133
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +643 -298
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/callUtils.js +187 -0
- package/dist/common/callUtils.js.map +1 -0
- package/dist/common/callUtils.test.js +313 -0
- package/dist/common/callUtils.test.js.map +1 -0
- package/dist/common/constants.js +27 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js +11 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +11 -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 +228 -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 +493 -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 +614 -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 +747 -0
- package/dist/mobius-socket/socket.test.js.map +1 -0
- package/dist/mobius-socket/test/mocha-helpers.js +23 -0
- package/dist/mobius-socket/test/mocha-helpers.js.map +1 -0
- package/dist/mobius-socket/test/promise-tick.js +28 -0
- package/dist/mobius-socket/test/promise-tick.js.map +1 -0
- package/dist/mobius-socket/types.js +7 -0
- package/dist/mobius-socket/types.js.map +1 -0
- package/dist/module/CallHistory/CallHistory.js +1 -1
- package/dist/module/CallQueue/CallQueue.js +718 -0
- package/dist/module/CallQueue/constants.js +41 -0
- package/dist/module/CallQueue/types.js +1 -0
- package/dist/module/CallQueue/utils.js +253 -0
- package/dist/module/CallRecording/CallRecording.js +56 -0
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +349 -0
- package/dist/module/CallRecording/callRecordingFixtures.js +231 -0
- package/dist/module/CallRecording/constants.js +27 -0
- package/dist/module/CallRecording/types.js +19 -0
- package/dist/module/CallRecording/userhub.js +100 -0
- package/dist/module/CallRecording/utils.js +14 -0
- package/dist/module/CallingClient/CallingClient.js +137 -20
- package/dist/module/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/module/CallingClient/calling/call.js +207 -68
- package/dist/module/CallingClient/calling/callManager.js +51 -11
- package/dist/module/CallingClient/calling/types.js +2 -0
- package/dist/module/CallingClient/constants.js +29 -1
- package/dist/module/CallingClient/line/index.js +11 -3
- package/dist/module/CallingClient/registration/register.js +297 -68
- 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 +24 -10
- package/dist/module/Metrics/index.js +48 -1
- package/dist/module/Metrics/types.js +18 -0
- package/dist/module/Voicemail/Voicemail.js +10 -10
- package/dist/module/api.js +6 -2
- package/dist/module/common/Utils.js +110 -63
- package/dist/module/common/callUtils.js +90 -0
- package/dist/module/common/constants.js +11 -0
- package/dist/module/common/index.js +1 -0
- package/dist/module/common/testUtil.js +7 -1
- package/dist/module/common/types.js +3 -0
- package/dist/module/index.js +10 -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 +376 -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/CallQueue/CallQueue.d.ts +45 -0
- package/dist/types/CallQueue/CallQueue.d.ts.map +1 -0
- package/dist/types/CallQueue/constants.d.ts +37 -0
- package/dist/types/CallQueue/constants.d.ts.map +1 -0
- package/dist/types/CallQueue/types.d.ts +97 -0
- package/dist/types/CallQueue/types.d.ts.map +1 -0
- package/dist/types/CallQueue/utils.d.ts +19 -0
- package/dist/types/CallQueue/utils.d.ts.map +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 +27 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +152 -0
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -0
- package/dist/types/CallRecording/constants.d.ts +28 -0
- package/dist/types/CallRecording/constants.d.ts.map +1 -0
- package/dist/types/CallRecording/types.d.ts +184 -0
- package/dist/types/CallRecording/types.d.ts.map +1 -0
- package/dist/types/CallRecording/userhub.d.ts +44 -0
- package/dist/types/CallRecording/userhub.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/CallerId/index.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 +29 -1
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +3 -2
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +9 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +26 -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 +6 -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 +81 -16
- 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 +41 -13
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/api.d.ts +10 -4
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +11 -5
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/callUtils.d.ts +6 -0
- package/dist/types/common/callUtils.d.ts.map +1 -0
- package/dist/types/common/constants.d.ts +6 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +6 -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 +13 -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 -18
- package/src/mobius-socket/socket/socket.shim.ts +22 -0
- package/src/mobius-socket/socket/socket.ts +14 -0
|
@@ -29,6 +29,7 @@ var _mediaHelpers = require("@webex/media-helpers");
|
|
|
29
29
|
var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
|
|
30
30
|
var _types = require("../../Errors/types");
|
|
31
31
|
var _Utils = require("../../common/Utils");
|
|
32
|
+
var _callUtils = require("../../common/callUtils");
|
|
32
33
|
var _types2 = require("../../common/types");
|
|
33
34
|
var _CallError = require("../../Errors/catalog/CallError");
|
|
34
35
|
var _constants = require("../constants");
|
|
@@ -41,6 +42,7 @@ var _CallerId = require("./CallerId");
|
|
|
41
42
|
var _types5 = require("../../Metrics/types");
|
|
42
43
|
var _Metrics = require("../../Metrics");
|
|
43
44
|
var _constants2 = require("../../common/constants");
|
|
45
|
+
var _request = require("../utils/request");
|
|
44
46
|
function ownKeys(e, r) { var t = _Object$keys(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; }
|
|
45
47
|
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; }
|
|
46
48
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -52,7 +54,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
52
54
|
/**
|
|
53
55
|
* @ignore
|
|
54
56
|
*/
|
|
55
|
-
function Call(activeUrl, webex, direction, deviceId, lineId, deleteCb, indicator, destination) {
|
|
57
|
+
function Call(activeUrl, webex, direction, deviceId, lineId, deleteCb, indicator, destination, iceGatheringConfig) {
|
|
56
58
|
var _this;
|
|
57
59
|
(0, _classCallCheck2.default)(this, Call);
|
|
58
60
|
_this = _callSuper(this, Call);
|
|
@@ -92,10 +94,194 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
92
94
|
// Used in WxCC calls
|
|
93
95
|
(0, _defineProperty2.default)(_this, "serviceIndicator", void 0);
|
|
94
96
|
(0, _defineProperty2.default)(_this, "mediaNegotiationCompleted", void 0);
|
|
97
|
+
(0, _defineProperty2.default)(_this, "connectPending", void 0);
|
|
95
98
|
(0, _defineProperty2.default)(_this, "receivedRoapOKSeq", void 0);
|
|
96
99
|
(0, _defineProperty2.default)(_this, "localAudioStream", void 0);
|
|
97
100
|
(0, _defineProperty2.default)(_this, "rtcMetrics", void 0);
|
|
98
101
|
(0, _defineProperty2.default)(_this, "callKeepaliveRetryCount", 0);
|
|
102
|
+
(0, _defineProperty2.default)(_this, "apiRequest", void 0);
|
|
103
|
+
(0, _defineProperty2.default)(_this, "iceGatheringConfig", void 0);
|
|
104
|
+
(0, _defineProperty2.default)(_this, "handleMediaRoapEvent", /*#__PURE__*/function () {
|
|
105
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(event) {
|
|
106
|
+
var _event$roapMessage, _event$roapMessage2;
|
|
107
|
+
var mediaOk, sdpVideoPortZero, _t;
|
|
108
|
+
return _regenerator.default.wrap(function (_context) {
|
|
109
|
+
while (1) switch (_context.prev = _context.next) {
|
|
110
|
+
case 0:
|
|
111
|
+
_Logger.default.info("ROAP message to send (rcv from MEDIA-SDK) :\n \n type: ".concat((_event$roapMessage = event.roapMessage) === null || _event$roapMessage === void 0 ? void 0 : _event$roapMessage.messageType, ", seq: ").concat(event.roapMessage.seq, " , version: ").concat(event.roapMessage.version), {
|
|
112
|
+
file: _constants.CALL_FILE,
|
|
113
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
114
|
+
});
|
|
115
|
+
_Logger.default.info("SDP message to send : \n ".concat((_event$roapMessage2 = event.roapMessage) === null || _event$roapMessage2 === void 0 ? void 0 : _event$roapMessage2.sdp), {
|
|
116
|
+
file: _constants.CALL_FILE,
|
|
117
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
118
|
+
});
|
|
119
|
+
_t = event.roapMessage.messageType;
|
|
120
|
+
_context.next = _t === _types4.RoapScenario.OK ? 1 : _t === _types4.RoapScenario.OFFER ? 2 : _t === _types4.RoapScenario.ANSWER ? 4 : _t === _types4.RoapScenario.ERROR ? 6 : _t === _types4.RoapScenario.OFFER_RESPONSE ? 7 : 9;
|
|
121
|
+
break;
|
|
122
|
+
case 1:
|
|
123
|
+
mediaOk = {
|
|
124
|
+
received: false,
|
|
125
|
+
message: event.roapMessage
|
|
126
|
+
};
|
|
127
|
+
_this.sendMediaStateMachineEvt({
|
|
128
|
+
type: 'E_ROAP_OK',
|
|
129
|
+
data: mediaOk
|
|
130
|
+
});
|
|
131
|
+
return _context.abrupt("continue", 9);
|
|
132
|
+
case 2:
|
|
133
|
+
if (event.roapMessage.sdp) {
|
|
134
|
+
_context.next = 3;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
_Logger.default.warn('Received OFFER without SDP from media SDK', {
|
|
138
|
+
file: _constants.CALL_FILE,
|
|
139
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
140
|
+
});
|
|
141
|
+
return _context.abrupt("continue", 9);
|
|
142
|
+
case 3:
|
|
143
|
+
// TODO: Remove these after the Media-Core adds the fix
|
|
144
|
+
// Check if at least one IPv6 "c=" line is present
|
|
145
|
+
_Logger.default.info("before modifying sdp: ".concat(event.roapMessage.sdp), {
|
|
146
|
+
file: _constants.CALL_FILE,
|
|
147
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
148
|
+
});
|
|
149
|
+
event.roapMessage.sdp = (0, _callUtils.modifySdpForIPv4)(event.roapMessage.sdp);
|
|
150
|
+
sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\d+) /gim, 'm=$1 0 ');
|
|
151
|
+
_Logger.default.info("after modification sdp: ".concat(sdpVideoPortZero), {
|
|
152
|
+
file: _constants.CALL_FILE,
|
|
153
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
154
|
+
});
|
|
155
|
+
event.roapMessage.sdp = sdpVideoPortZero;
|
|
156
|
+
_this.localRoapMessage = event.roapMessage;
|
|
157
|
+
_this.sendCallStateMachineEvt({
|
|
158
|
+
type: 'E_SEND_CALL_SETUP',
|
|
159
|
+
data: event.roapMessage
|
|
160
|
+
});
|
|
161
|
+
return _context.abrupt("continue", 9);
|
|
162
|
+
case 4:
|
|
163
|
+
if (event.roapMessage.sdp) {
|
|
164
|
+
_context.next = 5;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
_Logger.default.warn('Received OFFER without SDP from media SDK', {
|
|
168
|
+
file: _constants.CALL_FILE,
|
|
169
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
170
|
+
});
|
|
171
|
+
return _context.abrupt("continue", 9);
|
|
172
|
+
case 5:
|
|
173
|
+
event.roapMessage.sdp = (0, _callUtils.modifySdpForIPv4)(event.roapMessage.sdp);
|
|
174
|
+
_this.localRoapMessage = event.roapMessage;
|
|
175
|
+
if (_this.connectPending) {
|
|
176
|
+
_this.sendCallStateMachineEvt({
|
|
177
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
_this.sendMediaStateMachineEvt({
|
|
181
|
+
type: 'E_SEND_ROAP_ANSWER',
|
|
182
|
+
data: event.roapMessage
|
|
183
|
+
});
|
|
184
|
+
return _context.abrupt("continue", 9);
|
|
185
|
+
case 6:
|
|
186
|
+
_this.sendMediaStateMachineEvt({
|
|
187
|
+
type: 'E_ROAP_ERROR',
|
|
188
|
+
data: event.roapMessage
|
|
189
|
+
});
|
|
190
|
+
return _context.abrupt("continue", 9);
|
|
191
|
+
case 7:
|
|
192
|
+
if (event.roapMessage.sdp) {
|
|
193
|
+
_context.next = 8;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
_Logger.default.warn('Received OFFER without SDP from media SDK', {
|
|
197
|
+
file: _constants.CALL_FILE,
|
|
198
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
199
|
+
});
|
|
200
|
+
return _context.abrupt("continue", 9);
|
|
201
|
+
case 8:
|
|
202
|
+
event.roapMessage.sdp = (0, _callUtils.modifySdpForIPv4)(event.roapMessage.sdp);
|
|
203
|
+
_this.localRoapMessage = event.roapMessage;
|
|
204
|
+
if (_this.connectPending) {
|
|
205
|
+
_this.sendCallStateMachineEvt({
|
|
206
|
+
type: 'E_SEND_CALL_CONNECT'
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
_this.sendMediaStateMachineEvt({
|
|
210
|
+
type: 'E_SEND_ROAP_OFFER',
|
|
211
|
+
data: event.roapMessage
|
|
212
|
+
});
|
|
213
|
+
return _context.abrupt("continue", 9);
|
|
214
|
+
case 9:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context.stop();
|
|
217
|
+
}
|
|
218
|
+
}, _callee);
|
|
219
|
+
}));
|
|
220
|
+
return function (_x) {
|
|
221
|
+
return _ref.apply(this, arguments);
|
|
222
|
+
};
|
|
223
|
+
}());
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
225
|
+
(0, _defineProperty2.default)(_this, "handleRemoteTrackAdded", function (event) {
|
|
226
|
+
if (event.type === _types3.MEDIA_CONNECTION_EVENT_KEYS.MEDIA_TYPE_AUDIO) {
|
|
227
|
+
_this.emit(_types3.CALL_EVENT_KEYS.REMOTE_MEDIA, event.track);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
(0, _defineProperty2.default)(_this, "handleIceGatheringStateChanged", function (event) {
|
|
231
|
+
var iceGatheringState = Call.getPeerConnectionStateFromEvent(event, 'iceGatheringState');
|
|
232
|
+
_Logger.default.info("ICE gathering state changed to: ".concat(iceGatheringState), {
|
|
233
|
+
file: _constants.CALL_FILE,
|
|
234
|
+
method: _constants.METHODS.MEDIA_ICE_EVENTS_LISTENER
|
|
235
|
+
});
|
|
236
|
+
_this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA, _types5.MEDIA_CONNECTION_ACTION.ICE_GATHERING_STATE_CHANGED, _types5.METRIC_TYPE.BEHAVIORAL, _this.callId, _this.correlationId, undefined, undefined, iceGatheringState);
|
|
237
|
+
});
|
|
238
|
+
(0, _defineProperty2.default)(_this, "handlePeerConnectionStateChanged", function (event) {
|
|
239
|
+
var connectionState = Call.getPeerConnectionStateFromEvent(event, 'connectionState');
|
|
240
|
+
_Logger.default.info("Peer connection state changed to: ".concat(connectionState), {
|
|
241
|
+
file: _constants.CALL_FILE,
|
|
242
|
+
method: _constants.METHODS.MEDIA_ICE_EVENTS_LISTENER
|
|
243
|
+
});
|
|
244
|
+
_this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA, _types5.MEDIA_CONNECTION_ACTION.PEER_CONNECTION_STATE_CHANGED, _types5.METRIC_TYPE.BEHAVIORAL, _this.callId, _this.correlationId, undefined, undefined, connectionState);
|
|
245
|
+
});
|
|
246
|
+
(0, _defineProperty2.default)(_this, "handleIceConnectionStateChanged", function (event) {
|
|
247
|
+
var iceConnectionState = Call.getPeerConnectionStateFromEvent(event, 'iceConnectionState');
|
|
248
|
+
_Logger.default.info("ICE connection state changed to: ".concat(iceConnectionState), {
|
|
249
|
+
file: _constants.CALL_FILE,
|
|
250
|
+
method: _constants.METHODS.MEDIA_ICE_EVENTS_LISTENER
|
|
251
|
+
});
|
|
252
|
+
_this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA, _types5.MEDIA_CONNECTION_ACTION.ICE_CONNECTION_STATE_CHANGED, _types5.METRIC_TYPE.BEHAVIORAL, _this.callId, _this.correlationId, undefined, undefined, iceConnectionState);
|
|
253
|
+
});
|
|
254
|
+
(0, _defineProperty2.default)(_this, "handleIceCandidateError", function (event) {
|
|
255
|
+
var _event$address, _event$port;
|
|
256
|
+
var iceErrorPayload = {
|
|
257
|
+
address: (_event$address = event.address) !== null && _event$address !== void 0 ? _event$address : null,
|
|
258
|
+
errorCode: event.errorCode,
|
|
259
|
+
errorText: event.errorText,
|
|
260
|
+
port: (_event$port = event.port) !== null && _event$port !== void 0 ? _event$port : null,
|
|
261
|
+
url: event.url
|
|
262
|
+
};
|
|
263
|
+
_Logger.default.warn("ICE candidate error occurred: ".concat((0, _stringify.default)(iceErrorPayload)), {
|
|
264
|
+
file: _constants.CALL_FILE,
|
|
265
|
+
method: _constants.METHODS.MEDIA_ICE_EVENTS_LISTENER
|
|
266
|
+
});
|
|
267
|
+
var callError = (0, _CallError.createCallError)("ICE candidate error occurred: ".concat((0, _stringify.default)(iceErrorPayload)), {
|
|
268
|
+
file: _constants.CALL_FILE,
|
|
269
|
+
method: _constants.METHODS.MEDIA_ICE_EVENTS_LISTENER
|
|
270
|
+
}, _types.ERROR_TYPE.CALL_ERROR, _this.correlationId, _types.ERROR_LAYER.MEDIA);
|
|
271
|
+
_this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA_ERROR, _types5.MEDIA_CONNECTION_ACTION.ICE_CANDIDATE_ERROR, _types5.METRIC_TYPE.BEHAVIORAL, _this.callId, _this.correlationId, undefined, undefined, undefined, callError);
|
|
272
|
+
});
|
|
273
|
+
(0, _defineProperty2.default)(_this, "handleRoapFailure", function (error) {
|
|
274
|
+
var failureMessage = error.message || 'Unknown ROAP failure received from media SDK';
|
|
275
|
+
_Logger.default.warn("ROAP failure occurred: ".concat(failureMessage), {
|
|
276
|
+
file: _constants.CALL_FILE,
|
|
277
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
278
|
+
});
|
|
279
|
+
var callError = (0, _CallError.createCallError)("ROAP failure occurred: ".concat(failureMessage), {
|
|
280
|
+
file: _constants.CALL_FILE,
|
|
281
|
+
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
282
|
+
}, _types.ERROR_TYPE.CALL_ERROR, _this.correlationId, _types.ERROR_LAYER.MEDIA);
|
|
283
|
+
_this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA_ERROR, _types5.MEDIA_CONNECTION_ACTION.ROAP_FAILURE, _types5.METRIC_TYPE.BEHAVIORAL, _this.callId, _this.correlationId, undefined, undefined, undefined, callError);
|
|
284
|
+
});
|
|
99
285
|
(0, _defineProperty2.default)(_this, "callKeepaliveRetryCallback", function (interval) {
|
|
100
286
|
if (_this.callKeepaliveRetryCount === _constants.MAX_CALL_KEEPALIVE_RETRY_COUNT) {
|
|
101
287
|
_Logger.default.warn("Max keepalive retry attempts reached. Aborting call keepalive for callId: ".concat(_this.callId), {
|
|
@@ -105,35 +291,35 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
105
291
|
return;
|
|
106
292
|
}
|
|
107
293
|
_this.callKeepaliveRetryCount += 1;
|
|
108
|
-
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
109
|
-
var
|
|
110
|
-
return _regenerator.default.wrap(function (
|
|
111
|
-
while (1) switch (
|
|
294
|
+
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
295
|
+
var _t2;
|
|
296
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
297
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
112
298
|
case 0:
|
|
113
|
-
|
|
114
|
-
|
|
299
|
+
_context2.prev = 0;
|
|
300
|
+
_context2.next = 1;
|
|
115
301
|
return _this.postStatus();
|
|
116
302
|
case 1:
|
|
117
303
|
_this.scheduleCallKeepaliveInterval();
|
|
118
|
-
|
|
304
|
+
_context2.next = 3;
|
|
119
305
|
break;
|
|
120
306
|
case 2:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return _this.handleCallKeepaliveError(
|
|
307
|
+
_context2.prev = 2;
|
|
308
|
+
_t2 = _context2["catch"](0);
|
|
309
|
+
_context2.next = 3;
|
|
310
|
+
return _this.handleCallKeepaliveError(_t2);
|
|
125
311
|
case 3:
|
|
126
312
|
case "end":
|
|
127
|
-
return
|
|
313
|
+
return _context2.stop();
|
|
128
314
|
}
|
|
129
|
-
},
|
|
315
|
+
}, _callee2, null, [[0, 2]]);
|
|
130
316
|
})), interval * 1000);
|
|
131
317
|
});
|
|
132
318
|
(0, _defineProperty2.default)(_this, "handleCallKeepaliveError", /*#__PURE__*/function () {
|
|
133
|
-
var
|
|
319
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(err) {
|
|
134
320
|
var error, abort;
|
|
135
|
-
return _regenerator.default.wrap(function (
|
|
136
|
-
while (1) switch (
|
|
321
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
322
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
137
323
|
case 0:
|
|
138
324
|
error = err;
|
|
139
325
|
/* We are clearing the timer here as all are error scenarios. Only scenario where
|
|
@@ -145,13 +331,13 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
145
331
|
if (_this.sessionTimer) {
|
|
146
332
|
clearInterval(_this.sessionTimer);
|
|
147
333
|
}
|
|
148
|
-
|
|
334
|
+
_context3.next = 1;
|
|
149
335
|
return (0, _Utils.handleCallErrors)(function (callError) {
|
|
150
336
|
_this.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, callError);
|
|
151
337
|
_this.submitCallErrorMetric(callError);
|
|
152
338
|
}, _types.ERROR_LAYER.CALL_CONTROL, _this.callKeepaliveRetryCallback, _this.getCorrelationId(), error, 'handleCallEstablished', _constants.CALL_FILE);
|
|
153
339
|
case 1:
|
|
154
|
-
abort =
|
|
340
|
+
abort = _context3.sent;
|
|
155
341
|
if (abort) {
|
|
156
342
|
_this.sendCallStateMachineEvt({
|
|
157
343
|
type: 'E_SEND_CALL_DISCONNECT'
|
|
@@ -159,7 +345,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
159
345
|
_this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, _this.getCorrelationId());
|
|
160
346
|
_this.callKeepaliveRetryCount = 0;
|
|
161
347
|
}
|
|
162
|
-
|
|
348
|
+
_context3.next = 2;
|
|
163
349
|
return (0, _Utils.uploadLogs)({
|
|
164
350
|
correlationId: _this.correlationId,
|
|
165
351
|
callId: _this.callId,
|
|
@@ -167,12 +353,12 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
167
353
|
});
|
|
168
354
|
case 2:
|
|
169
355
|
case "end":
|
|
170
|
-
return
|
|
356
|
+
return _context3.stop();
|
|
171
357
|
}
|
|
172
|
-
},
|
|
358
|
+
}, _callee3);
|
|
173
359
|
}));
|
|
174
|
-
return function (
|
|
175
|
-
return
|
|
360
|
+
return function (_x2) {
|
|
361
|
+
return _ref3.apply(this, arguments);
|
|
176
362
|
};
|
|
177
363
|
}());
|
|
178
364
|
(0, _defineProperty2.default)(_this, "scheduleCallKeepaliveInterval", function () {
|
|
@@ -181,29 +367,29 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
181
367
|
method: 'scheduleCallKeepaliveInterval'
|
|
182
368
|
};
|
|
183
369
|
clearInterval(_this.sessionTimer);
|
|
184
|
-
_this.sessionTimer = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
185
|
-
var res,
|
|
186
|
-
return _regenerator.default.wrap(function (
|
|
187
|
-
while (1) switch (
|
|
370
|
+
_this.sessionTimer = setInterval(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
371
|
+
var res, _t3;
|
|
372
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
373
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
188
374
|
case 0:
|
|
189
|
-
|
|
190
|
-
|
|
375
|
+
_context4.prev = 0;
|
|
376
|
+
_context4.next = 1;
|
|
191
377
|
return _this.postStatus();
|
|
192
378
|
case 1:
|
|
193
|
-
res =
|
|
379
|
+
res = _context4.sent;
|
|
194
380
|
_Logger.default.info("Session refresh successful", loggerContext);
|
|
195
|
-
|
|
381
|
+
_context4.next = 3;
|
|
196
382
|
break;
|
|
197
383
|
case 2:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return _this.handleCallKeepaliveError(
|
|
384
|
+
_context4.prev = 2;
|
|
385
|
+
_t3 = _context4["catch"](0);
|
|
386
|
+
_context4.next = 3;
|
|
387
|
+
return _this.handleCallKeepaliveError(_t3);
|
|
202
388
|
case 3:
|
|
203
389
|
case "end":
|
|
204
|
-
return
|
|
390
|
+
return _context4.stop();
|
|
205
391
|
}
|
|
206
|
-
},
|
|
392
|
+
}, _callee4, null, [[0, 2]]);
|
|
207
393
|
})), _constants.DEFAULT_SESSION_TIMER);
|
|
208
394
|
});
|
|
209
395
|
/**
|
|
@@ -213,34 +399,34 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
213
399
|
* @returns {Promise<void>}
|
|
214
400
|
*/
|
|
215
401
|
(0, _defineProperty2.default)(_this, "forceSendStatsReport", /*#__PURE__*/function () {
|
|
216
|
-
var
|
|
217
|
-
var callFrom, loggerContext, errorInfo, errorStatus,
|
|
218
|
-
return _regenerator.default.wrap(function (
|
|
219
|
-
while (1) switch (
|
|
402
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(_ref5) {
|
|
403
|
+
var callFrom, loggerContext, errorInfo, errorStatus, _t4;
|
|
404
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
405
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
220
406
|
case 0:
|
|
221
|
-
callFrom =
|
|
407
|
+
callFrom = _ref5.callFrom;
|
|
222
408
|
loggerContext = {
|
|
223
409
|
file: _constants.CALL_FILE,
|
|
224
410
|
method: _constants.METHODS.FORCE_SEND_STATS_REPORT
|
|
225
411
|
};
|
|
226
|
-
|
|
227
|
-
|
|
412
|
+
_context5.prev = 1;
|
|
413
|
+
_context5.next = 2;
|
|
228
414
|
return _this.mediaConnection.forceRtcMetricsSend();
|
|
229
415
|
case 2:
|
|
230
416
|
_Logger.default.info("Successfully uploaded available webrtc telemetry statistics", loggerContext);
|
|
231
417
|
_Logger.default.info("callFrom: ".concat(callFrom), loggerContext);
|
|
232
|
-
|
|
418
|
+
_context5.next = 5;
|
|
233
419
|
break;
|
|
234
420
|
case 3:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
errorInfo =
|
|
238
|
-
|
|
421
|
+
_context5.prev = 3;
|
|
422
|
+
_t4 = _context5["catch"](1);
|
|
423
|
+
errorInfo = _t4;
|
|
424
|
+
_context5.next = 4;
|
|
239
425
|
return (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext);
|
|
240
426
|
case 4:
|
|
241
|
-
errorStatus =
|
|
427
|
+
errorStatus = _context5.sent;
|
|
242
428
|
_Logger.default.error("Failed to upload webrtc telemetry statistics. ".concat((0, _stringify.default)(errorStatus)), loggerContext);
|
|
243
|
-
|
|
429
|
+
_context5.next = 5;
|
|
244
430
|
return (0, _Utils.uploadLogs)({
|
|
245
431
|
correlationId: _this.correlationId,
|
|
246
432
|
callId: _this.callId,
|
|
@@ -248,12 +434,12 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
248
434
|
});
|
|
249
435
|
case 5:
|
|
250
436
|
case "end":
|
|
251
|
-
return
|
|
437
|
+
return _context5.stop();
|
|
252
438
|
}
|
|
253
|
-
},
|
|
439
|
+
}, _callee5, null, [[1, 3]]);
|
|
254
440
|
}));
|
|
255
|
-
return function (
|
|
256
|
-
return
|
|
441
|
+
return function (_x3) {
|
|
442
|
+
return _ref6.apply(this, arguments);
|
|
257
443
|
};
|
|
258
444
|
}());
|
|
259
445
|
/**
|
|
@@ -301,11 +487,13 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
301
487
|
* @param roapMessage
|
|
302
488
|
*/
|
|
303
489
|
(0, _defineProperty2.default)(_this, "post", /*#__PURE__*/function () {
|
|
304
|
-
var
|
|
305
|
-
var basePayload;
|
|
306
|
-
return _regenerator.default.wrap(function (
|
|
307
|
-
while (1) switch (
|
|
490
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(roapMessage) {
|
|
491
|
+
var hostIps, basePayload;
|
|
492
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
493
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
308
494
|
case 0:
|
|
495
|
+
/* The state machine can dispatch a call setup without a ROAP message attached. */
|
|
496
|
+
hostIps = (0, _callUtils.getHostIpsFromSdp)(roapMessage === null || roapMessage === void 0 ? void 0 : roapMessage.sdp);
|
|
309
497
|
basePayload = {
|
|
310
498
|
device: {
|
|
311
499
|
deviceId: _this.deviceId,
|
|
@@ -314,9 +502,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
314
502
|
localMedia: {
|
|
315
503
|
roap: roapMessage,
|
|
316
504
|
mediaId: (0, _uuid.v4)()
|
|
317
|
-
}
|
|
505
|
+
},
|
|
506
|
+
hostIps: hostIps
|
|
318
507
|
};
|
|
319
|
-
return
|
|
508
|
+
return _context6.abrupt("return", _this.apiRequest.makeRequest({
|
|
320
509
|
uri: "".concat(_this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(_this.deviceId, "/").concat(_constants.CALL_ENDPOINT_RESOURCE),
|
|
321
510
|
method: _types2.HTTP_METHODS.POST,
|
|
322
511
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -330,12 +519,12 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
330
519
|
}));
|
|
331
520
|
case 1:
|
|
332
521
|
case "end":
|
|
333
|
-
return
|
|
522
|
+
return _context6.stop();
|
|
334
523
|
}
|
|
335
|
-
},
|
|
524
|
+
}, _callee6);
|
|
336
525
|
}));
|
|
337
|
-
return function (
|
|
338
|
-
return
|
|
526
|
+
return function (_x4) {
|
|
527
|
+
return _ref7.apply(this, arguments);
|
|
339
528
|
};
|
|
340
529
|
}());
|
|
341
530
|
(0, _defineProperty2.default)(_this, "onEffectEnabled", function () {
|
|
@@ -352,7 +541,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
352
541
|
(0, _defineProperty2.default)(_this, "registerEffectListener", function (addedEffect) {
|
|
353
542
|
if (_this.localAudioStream) {
|
|
354
543
|
var effect = _this.localAudioStream.getEffectByKind(_constants.NOISE_REDUCTION_EFFECT);
|
|
355
|
-
if (effect === addedEffect) {
|
|
544
|
+
if (effect && effect === addedEffect) {
|
|
356
545
|
effect.on(_mediaHelpers.EffectEvent.Enabled, _this.onEffectEnabled);
|
|
357
546
|
effect.on(_mediaHelpers.EffectEvent.Disabled, _this.onEffectDisabled);
|
|
358
547
|
}
|
|
@@ -466,6 +655,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
466
655
|
_this.deviceId = deviceId;
|
|
467
656
|
_this.serviceIndicator = indicator;
|
|
468
657
|
_this.lineId = lineId;
|
|
658
|
+
_this.iceGatheringConfig = iceGatheringConfig;
|
|
469
659
|
|
|
470
660
|
/* istanbul ignore else */
|
|
471
661
|
if (!_this.sdkConnector.getWebex()) {
|
|
@@ -485,6 +675,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
485
675
|
_this.mobiusUrl = activeUrl;
|
|
486
676
|
_this.receivedRoapOKSeq = 0;
|
|
487
677
|
_this.mediaNegotiationCompleted = false;
|
|
678
|
+
_this.connectPending = false;
|
|
488
679
|
_Logger.default.info("Webex Calling Url:- ".concat(_this.mobiusUrl), {
|
|
489
680
|
file: _constants.CALL_FILE,
|
|
490
681
|
method: _constants.METHODS.CONSTRUCTOR
|
|
@@ -506,6 +697,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
506
697
|
_this.rtcMetrics = new _internalPluginMetrics.RtcMetrics(_this.webex, {
|
|
507
698
|
callId: _this.callId
|
|
508
699
|
}, _this.correlationId);
|
|
700
|
+
_this.apiRequest = _request.APIRequest.getInstance({
|
|
701
|
+
webex: _this.webex
|
|
702
|
+
});
|
|
509
703
|
var callMachine = (0, _xstate.createMachine)({
|
|
510
704
|
schema: {
|
|
511
705
|
context: {},
|
|
@@ -690,6 +884,13 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
690
884
|
}
|
|
691
885
|
},
|
|
692
886
|
on: {
|
|
887
|
+
E_SEND_CALL_CONNECT: {
|
|
888
|
+
cond: function cond() {
|
|
889
|
+
return _this.connectPending;
|
|
890
|
+
},
|
|
891
|
+
target: 'S_SEND_CALL_CONNECT',
|
|
892
|
+
actions: ['outgoingCallConnect']
|
|
893
|
+
},
|
|
693
894
|
E_CALL_ESTABLISHED: {
|
|
694
895
|
target: 'S_CALL_ESTABLISHED',
|
|
695
896
|
actions: ['callEstablished']
|
|
@@ -1244,22 +1445,22 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1244
1445
|
}, {
|
|
1245
1446
|
key: "handleOutgoingCallSetup",
|
|
1246
1447
|
value: (function () {
|
|
1247
|
-
var _handleOutgoingCallSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1448
|
+
var _handleOutgoingCallSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7(event) {
|
|
1248
1449
|
var _this2 = this;
|
|
1249
|
-
var message, response, errData,
|
|
1250
|
-
return _regenerator.default.wrap(function (
|
|
1251
|
-
while (1) switch (
|
|
1450
|
+
var message, response, errData, _t5;
|
|
1451
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
1452
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1252
1453
|
case 0:
|
|
1253
1454
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1254
1455
|
file: _constants.CALL_FILE,
|
|
1255
1456
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP
|
|
1256
1457
|
});
|
|
1257
1458
|
message = event.data;
|
|
1258
|
-
|
|
1259
|
-
|
|
1459
|
+
_context7.prev = 1;
|
|
1460
|
+
_context7.next = 2;
|
|
1260
1461
|
return this.post(message);
|
|
1261
1462
|
case 2:
|
|
1262
|
-
response =
|
|
1463
|
+
response = _context7.sent;
|
|
1263
1464
|
_Logger.default.info("Response: ".concat((0, _stringify.default)(response)), {
|
|
1264
1465
|
file: _constants.CALL_FILE,
|
|
1265
1466
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP
|
|
@@ -1273,16 +1474,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1273
1474
|
file: _constants.CALL_FILE,
|
|
1274
1475
|
method: this.handleOutgoingCallSetup.name
|
|
1275
1476
|
});
|
|
1276
|
-
|
|
1477
|
+
_context7.next = 4;
|
|
1277
1478
|
break;
|
|
1278
1479
|
case 3:
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
_Logger.default.error("Failed to setup the call: ".concat((0, _stringify.default)(
|
|
1480
|
+
_context7.prev = 3;
|
|
1481
|
+
_t5 = _context7["catch"](1);
|
|
1482
|
+
_Logger.default.error("Failed to setup the call: ".concat((0, _stringify.default)(_t5)), {
|
|
1282
1483
|
file: _constants.CALL_FILE,
|
|
1283
1484
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP
|
|
1284
1485
|
});
|
|
1285
|
-
errData =
|
|
1486
|
+
errData = _t5;
|
|
1286
1487
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1287
1488
|
_this2.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
1288
1489
|
_this2.submitCallErrorMetric(error);
|
|
@@ -1296,7 +1497,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1296
1497
|
function (interval) {
|
|
1297
1498
|
return undefined;
|
|
1298
1499
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_CALL_SETUP, _constants.CALL_FILE);
|
|
1299
|
-
|
|
1500
|
+
_context7.next = 4;
|
|
1300
1501
|
return (0, _Utils.uploadLogs)({
|
|
1301
1502
|
correlationId: this.correlationId,
|
|
1302
1503
|
callId: this.callId,
|
|
@@ -1304,11 +1505,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1304
1505
|
});
|
|
1305
1506
|
case 4:
|
|
1306
1507
|
case "end":
|
|
1307
|
-
return
|
|
1508
|
+
return _context7.stop();
|
|
1308
1509
|
}
|
|
1309
|
-
},
|
|
1510
|
+
}, _callee7, this, [[1, 3]]);
|
|
1310
1511
|
}));
|
|
1311
|
-
function handleOutgoingCallSetup(
|
|
1512
|
+
function handleOutgoingCallSetup(_x5) {
|
|
1312
1513
|
return _handleOutgoingCallSetup.apply(this, arguments);
|
|
1313
1514
|
}
|
|
1314
1515
|
return handleOutgoingCallSetup;
|
|
@@ -1323,21 +1524,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1323
1524
|
}, {
|
|
1324
1525
|
key: "handleCallHold",
|
|
1325
1526
|
value: (function () {
|
|
1326
|
-
var _handleCallHold = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1527
|
+
var _handleCallHold = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9(event) {
|
|
1327
1528
|
var _this3 = this;
|
|
1328
|
-
var response, errData,
|
|
1329
|
-
return _regenerator.default.wrap(function (
|
|
1330
|
-
while (1) switch (
|
|
1529
|
+
var response, errData, _t6;
|
|
1530
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
1531
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1331
1532
|
case 0:
|
|
1332
1533
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1333
1534
|
file: _constants.CALL_FILE,
|
|
1334
1535
|
method: _constants.METHODS.HANDLE_CALL_HOLD
|
|
1335
1536
|
});
|
|
1336
|
-
|
|
1337
|
-
|
|
1537
|
+
_context9.prev = 1;
|
|
1538
|
+
_context9.next = 2;
|
|
1338
1539
|
return this.postSSRequest(undefined, _types3.SUPPLEMENTARY_SERVICES.HOLD);
|
|
1339
1540
|
case 2:
|
|
1340
|
-
response =
|
|
1541
|
+
response = _context9.sent;
|
|
1341
1542
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1342
1543
|
file: _constants.CALL_FILE,
|
|
1343
1544
|
method: _constants.METHODS.HANDLE_CALL_HOLD
|
|
@@ -1348,10 +1549,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1348
1549
|
* received from Mobius and forwarded towards calling client
|
|
1349
1550
|
*/
|
|
1350
1551
|
if (this.isHeld() === false) {
|
|
1351
|
-
this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1552
|
+
this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1352
1553
|
var errorContext, callError;
|
|
1353
|
-
return _regenerator.default.wrap(function (
|
|
1354
|
-
while (1) switch (
|
|
1554
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
1555
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1355
1556
|
case 0:
|
|
1356
1557
|
errorContext = {
|
|
1357
1558
|
file: _constants.CALL_FILE,
|
|
@@ -1366,21 +1567,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1366
1567
|
_this3.submitCallErrorMetric(callError);
|
|
1367
1568
|
case 1:
|
|
1368
1569
|
case "end":
|
|
1369
|
-
return
|
|
1570
|
+
return _context8.stop();
|
|
1370
1571
|
}
|
|
1371
|
-
},
|
|
1572
|
+
}, _callee8);
|
|
1372
1573
|
})), _constants.SUPPLEMENTARY_SERVICES_TIMEOUT);
|
|
1373
1574
|
}
|
|
1374
|
-
|
|
1575
|
+
_context9.next = 4;
|
|
1375
1576
|
break;
|
|
1376
1577
|
case 3:
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
_Logger.default.error("Failed to put the call on hold: ".concat((0, _stringify.default)(
|
|
1578
|
+
_context9.prev = 3;
|
|
1579
|
+
_t6 = _context9["catch"](1);
|
|
1580
|
+
_Logger.default.error("Failed to put the call on hold: ".concat((0, _stringify.default)(_t6)), {
|
|
1380
1581
|
file: _constants.CALL_FILE,
|
|
1381
1582
|
method: _constants.METHODS.HANDLE_CALL_HOLD
|
|
1382
1583
|
});
|
|
1383
|
-
errData =
|
|
1584
|
+
errData = _t6;
|
|
1384
1585
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1385
1586
|
_this3.emit(_types3.CALL_EVENT_KEYS.HOLD_ERROR, error);
|
|
1386
1587
|
_this3.submitCallErrorMetric(error);
|
|
@@ -1394,7 +1595,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1394
1595
|
function (interval) {
|
|
1395
1596
|
return undefined;
|
|
1396
1597
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_CALL_HOLD, _constants.CALL_FILE);
|
|
1397
|
-
|
|
1598
|
+
_context9.next = 4;
|
|
1398
1599
|
return (0, _Utils.uploadLogs)({
|
|
1399
1600
|
correlationId: this.correlationId,
|
|
1400
1601
|
callId: this.callId,
|
|
@@ -1402,11 +1603,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1402
1603
|
});
|
|
1403
1604
|
case 4:
|
|
1404
1605
|
case "end":
|
|
1405
|
-
return
|
|
1606
|
+
return _context9.stop();
|
|
1406
1607
|
}
|
|
1407
|
-
},
|
|
1608
|
+
}, _callee9, this, [[1, 3]]);
|
|
1408
1609
|
}));
|
|
1409
|
-
function handleCallHold(
|
|
1610
|
+
function handleCallHold(_x6) {
|
|
1410
1611
|
return _handleCallHold.apply(this, arguments);
|
|
1411
1612
|
}
|
|
1412
1613
|
return handleCallHold;
|
|
@@ -1421,21 +1622,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1421
1622
|
}, {
|
|
1422
1623
|
key: "handleCallResume",
|
|
1423
1624
|
value: (function () {
|
|
1424
|
-
var _handleCallResume = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1625
|
+
var _handleCallResume = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(event) {
|
|
1425
1626
|
var _this4 = this;
|
|
1426
|
-
var response, errData,
|
|
1427
|
-
return _regenerator.default.wrap(function (
|
|
1428
|
-
while (1) switch (
|
|
1627
|
+
var response, errData, _t7;
|
|
1628
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
1629
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1429
1630
|
case 0:
|
|
1430
1631
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1431
1632
|
file: _constants.CALL_FILE,
|
|
1432
1633
|
method: _constants.METHODS.HANDLE_CALL_RESUME
|
|
1433
1634
|
});
|
|
1434
|
-
|
|
1435
|
-
|
|
1635
|
+
_context1.prev = 1;
|
|
1636
|
+
_context1.next = 2;
|
|
1436
1637
|
return this.postSSRequest(undefined, _types3.SUPPLEMENTARY_SERVICES.RESUME);
|
|
1437
1638
|
case 2:
|
|
1438
|
-
response =
|
|
1639
|
+
response = _context1.sent;
|
|
1439
1640
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1440
1641
|
file: _constants.CALL_FILE,
|
|
1441
1642
|
method: _constants.METHODS.HANDLE_CALL_RESUME
|
|
@@ -1446,10 +1647,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1446
1647
|
* received from Mobius on resuming the call and forwarded towards calling client
|
|
1447
1648
|
*/
|
|
1448
1649
|
if (this.isHeld() === true) {
|
|
1449
|
-
this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1650
|
+
this.supplementaryServicesTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
1450
1651
|
var errorContext, callError;
|
|
1451
|
-
return _regenerator.default.wrap(function (
|
|
1452
|
-
while (1) switch (
|
|
1652
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
1653
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
1453
1654
|
case 0:
|
|
1454
1655
|
errorContext = {
|
|
1455
1656
|
file: _constants.CALL_FILE,
|
|
@@ -1464,21 +1665,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1464
1665
|
_this4.submitCallErrorMetric(callError);
|
|
1465
1666
|
case 1:
|
|
1466
1667
|
case "end":
|
|
1467
|
-
return
|
|
1668
|
+
return _context0.stop();
|
|
1468
1669
|
}
|
|
1469
|
-
},
|
|
1670
|
+
}, _callee0);
|
|
1470
1671
|
})), _constants.SUPPLEMENTARY_SERVICES_TIMEOUT);
|
|
1471
1672
|
}
|
|
1472
|
-
|
|
1673
|
+
_context1.next = 4;
|
|
1473
1674
|
break;
|
|
1474
1675
|
case 3:
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
_Logger.default.error("Failed to resume the call: ".concat((0, _stringify.default)(
|
|
1676
|
+
_context1.prev = 3;
|
|
1677
|
+
_t7 = _context1["catch"](1);
|
|
1678
|
+
_Logger.default.error("Failed to resume the call: ".concat((0, _stringify.default)(_t7)), {
|
|
1478
1679
|
file: _constants.CALL_FILE,
|
|
1479
1680
|
method: _constants.METHODS.HANDLE_CALL_RESUME
|
|
1480
1681
|
});
|
|
1481
|
-
errData =
|
|
1682
|
+
errData = _t7;
|
|
1482
1683
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1483
1684
|
_this4.emit(_types3.CALL_EVENT_KEYS.RESUME_ERROR, error);
|
|
1484
1685
|
_this4.submitCallErrorMetric(error);
|
|
@@ -1492,7 +1693,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1492
1693
|
function (interval) {
|
|
1493
1694
|
return undefined;
|
|
1494
1695
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_CALL_RESUME, _constants.CALL_FILE);
|
|
1495
|
-
|
|
1696
|
+
_context1.next = 4;
|
|
1496
1697
|
return (0, _Utils.uploadLogs)({
|
|
1497
1698
|
correlationId: this.correlationId,
|
|
1498
1699
|
callId: this.callId,
|
|
@@ -1500,11 +1701,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1500
1701
|
});
|
|
1501
1702
|
case 4:
|
|
1502
1703
|
case "end":
|
|
1503
|
-
return
|
|
1704
|
+
return _context1.stop();
|
|
1504
1705
|
}
|
|
1505
|
-
},
|
|
1706
|
+
}, _callee1, this, [[1, 3]]);
|
|
1506
1707
|
}));
|
|
1507
|
-
function handleCallResume(
|
|
1708
|
+
function handleCallResume(_x7) {
|
|
1508
1709
|
return _handleCallResume.apply(this, arguments);
|
|
1509
1710
|
}
|
|
1510
1711
|
return handleCallResume;
|
|
@@ -1593,35 +1794,35 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1593
1794
|
}, {
|
|
1594
1795
|
key: "handleOutgoingCallAlerting",
|
|
1595
1796
|
value: (function () {
|
|
1596
|
-
var _handleOutgoingCallAlerting = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1797
|
+
var _handleOutgoingCallAlerting = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(event) {
|
|
1597
1798
|
var _this5 = this;
|
|
1598
|
-
var res, errData,
|
|
1599
|
-
return _regenerator.default.wrap(function (
|
|
1600
|
-
while (1) switch (
|
|
1799
|
+
var res, errData, _t8;
|
|
1800
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
1801
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1601
1802
|
case 0:
|
|
1602
1803
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1603
1804
|
file: _constants.CALL_FILE,
|
|
1604
1805
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING
|
|
1605
1806
|
});
|
|
1606
|
-
|
|
1607
|
-
|
|
1807
|
+
_context10.prev = 1;
|
|
1808
|
+
_context10.next = 2;
|
|
1608
1809
|
return this.patch(_types4.MobiusCallState.ALERTING);
|
|
1609
1810
|
case 2:
|
|
1610
|
-
res =
|
|
1811
|
+
res = _context10.sent;
|
|
1611
1812
|
_Logger.default.log("PATCH response: ".concat(res.statusCode), {
|
|
1612
1813
|
file: _constants.CALL_FILE,
|
|
1613
1814
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING
|
|
1614
1815
|
});
|
|
1615
|
-
|
|
1816
|
+
_context10.next = 4;
|
|
1616
1817
|
break;
|
|
1617
1818
|
case 3:
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
_Logger.default.error("Failed to signal call progression: ".concat((0, _stringify.default)(
|
|
1819
|
+
_context10.prev = 3;
|
|
1820
|
+
_t8 = _context10["catch"](1);
|
|
1821
|
+
_Logger.default.error("Failed to signal call progression: ".concat((0, _stringify.default)(_t8)), {
|
|
1621
1822
|
file: _constants.CALL_FILE,
|
|
1622
1823
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING
|
|
1623
1824
|
});
|
|
1624
|
-
errData =
|
|
1825
|
+
errData = _t8;
|
|
1625
1826
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1626
1827
|
_this5.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
1627
1828
|
_this5.submitCallErrorMetric(error);
|
|
@@ -1635,7 +1836,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1635
1836
|
function (interval) {
|
|
1636
1837
|
return undefined;
|
|
1637
1838
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_CALL_ALERTING, _constants.CALL_FILE);
|
|
1638
|
-
|
|
1839
|
+
_context10.next = 4;
|
|
1639
1840
|
return (0, _Utils.uploadLogs)({
|
|
1640
1841
|
correlationId: this.correlationId,
|
|
1641
1842
|
callId: this.callId,
|
|
@@ -1643,11 +1844,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1643
1844
|
});
|
|
1644
1845
|
case 4:
|
|
1645
1846
|
case "end":
|
|
1646
|
-
return
|
|
1847
|
+
return _context10.stop();
|
|
1647
1848
|
}
|
|
1648
|
-
},
|
|
1849
|
+
}, _callee10, this, [[1, 3]]);
|
|
1649
1850
|
}));
|
|
1650
|
-
function handleOutgoingCallAlerting(
|
|
1851
|
+
function handleOutgoingCallAlerting(_x8) {
|
|
1651
1852
|
return _handleOutgoingCallAlerting.apply(this, arguments);
|
|
1652
1853
|
}
|
|
1653
1854
|
return handleOutgoingCallAlerting;
|
|
@@ -1688,12 +1889,13 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1688
1889
|
}, {
|
|
1689
1890
|
key: "handleOutgoingCallConnect",
|
|
1690
1891
|
value: (function () {
|
|
1691
|
-
var _handleOutgoingCallConnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1892
|
+
var _handleOutgoingCallConnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(event) {
|
|
1692
1893
|
var _this6 = this;
|
|
1693
|
-
var res, errData,
|
|
1694
|
-
return _regenerator.default.wrap(function (
|
|
1695
|
-
while (1) switch (
|
|
1894
|
+
var res, errData, _t9;
|
|
1895
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
1896
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1696
1897
|
case 0:
|
|
1898
|
+
this.connectPending = false;
|
|
1697
1899
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1698
1900
|
file: _constants.CALL_FILE,
|
|
1699
1901
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
|
|
@@ -1701,38 +1903,39 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1701
1903
|
|
|
1702
1904
|
/* We should have received an Offer by now */
|
|
1703
1905
|
if (this.remoteRoapMessage) {
|
|
1704
|
-
|
|
1906
|
+
_context11.next = 1;
|
|
1705
1907
|
break;
|
|
1706
1908
|
}
|
|
1707
1909
|
_Logger.default.warn('Offer not yet received from remote end... Exiting', {
|
|
1708
1910
|
file: _constants.CALL_FILE,
|
|
1709
1911
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
|
|
1710
1912
|
});
|
|
1711
|
-
|
|
1913
|
+
this.connectPending = true;
|
|
1914
|
+
return _context11.abrupt("return");
|
|
1712
1915
|
case 1:
|
|
1713
|
-
|
|
1916
|
+
_context11.prev = 1;
|
|
1714
1917
|
/* Start Offer/Answer as we might have buffered the offer by now */
|
|
1715
1918
|
this.mediaConnection.roapMessageReceived(this.remoteRoapMessage);
|
|
1716
1919
|
|
|
1717
1920
|
/* send call_connect PATCH */
|
|
1718
|
-
|
|
1921
|
+
_context11.next = 2;
|
|
1719
1922
|
return this.patch(_types4.MobiusCallState.CONNECTED);
|
|
1720
1923
|
case 2:
|
|
1721
|
-
res =
|
|
1924
|
+
res = _context11.sent;
|
|
1722
1925
|
_Logger.default.log("PATCH response: ".concat(res.statusCode), {
|
|
1723
1926
|
file: _constants.CALL_FILE,
|
|
1724
1927
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
|
|
1725
1928
|
});
|
|
1726
|
-
|
|
1929
|
+
_context11.next = 4;
|
|
1727
1930
|
break;
|
|
1728
1931
|
case 3:
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
_Logger.default.error("Failed to connect the call: ".concat((0, _stringify.default)(
|
|
1932
|
+
_context11.prev = 3;
|
|
1933
|
+
_t9 = _context11["catch"](1);
|
|
1934
|
+
_Logger.default.error("Failed to connect the call: ".concat((0, _stringify.default)(_t9)), {
|
|
1732
1935
|
file: _constants.CALL_FILE,
|
|
1733
1936
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT
|
|
1734
1937
|
});
|
|
1735
|
-
errData =
|
|
1938
|
+
errData = _t9;
|
|
1736
1939
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1737
1940
|
_this6.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
1738
1941
|
_this6.submitCallErrorMetric(error);
|
|
@@ -1746,7 +1949,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1746
1949
|
function (interval) {
|
|
1747
1950
|
return undefined;
|
|
1748
1951
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_CALL_CONNECT, _constants.CALL_FILE);
|
|
1749
|
-
|
|
1952
|
+
_context11.next = 4;
|
|
1750
1953
|
return (0, _Utils.uploadLogs)({
|
|
1751
1954
|
correlationId: this.correlationId,
|
|
1752
1955
|
callId: this.callId,
|
|
@@ -1754,11 +1957,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1754
1957
|
});
|
|
1755
1958
|
case 4:
|
|
1756
1959
|
case "end":
|
|
1757
|
-
return
|
|
1960
|
+
return _context11.stop();
|
|
1758
1961
|
}
|
|
1759
|
-
},
|
|
1962
|
+
}, _callee11, this, [[1, 3]]);
|
|
1760
1963
|
}));
|
|
1761
|
-
function handleOutgoingCallConnect(
|
|
1964
|
+
function handleOutgoingCallConnect(_x9) {
|
|
1762
1965
|
return _handleOutgoingCallConnect.apply(this, arguments);
|
|
1763
1966
|
}
|
|
1764
1967
|
return handleOutgoingCallConnect;
|
|
@@ -1773,10 +1976,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1773
1976
|
}, {
|
|
1774
1977
|
key: "handleIncomingCallDisconnect",
|
|
1775
1978
|
value: (function () {
|
|
1776
|
-
var _handleIncomingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1777
|
-
var response,
|
|
1778
|
-
return _regenerator.default.wrap(function (
|
|
1779
|
-
while (1) switch (
|
|
1979
|
+
var _handleIncomingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(event) {
|
|
1980
|
+
var response, _t0;
|
|
1981
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
1982
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1780
1983
|
case 0:
|
|
1781
1984
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1782
1985
|
file: _constants.CALL_FILE,
|
|
@@ -1784,21 +1987,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1784
1987
|
});
|
|
1785
1988
|
this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.correlationId);
|
|
1786
1989
|
this.setDisconnectReason();
|
|
1787
|
-
|
|
1788
|
-
|
|
1990
|
+
_context12.prev = 1;
|
|
1991
|
+
_context12.next = 2;
|
|
1789
1992
|
return this.delete();
|
|
1790
1993
|
case 2:
|
|
1791
|
-
response =
|
|
1994
|
+
response = _context12.sent;
|
|
1792
1995
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1793
1996
|
file: _constants.CALL_FILE,
|
|
1794
1997
|
method: _constants.METHODS.HANDLE_INCOMING_CALL_DISCONNECT
|
|
1795
1998
|
});
|
|
1796
|
-
|
|
1999
|
+
_context12.next = 4;
|
|
1797
2000
|
break;
|
|
1798
2001
|
case 3:
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
_Logger.default.warn("Failed to delete the call: ".concat((0, _stringify.default)(
|
|
2002
|
+
_context12.prev = 3;
|
|
2003
|
+
_t0 = _context12["catch"](1);
|
|
2004
|
+
_Logger.default.warn("Failed to delete the call: ".concat((0, _stringify.default)(_t0)), {
|
|
1802
2005
|
file: _constants.CALL_FILE,
|
|
1803
2006
|
method: _constants.METHODS.HANDLE_INCOMING_CALL_DISCONNECT
|
|
1804
2007
|
});
|
|
@@ -1820,6 +2023,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1820
2023
|
|
|
1821
2024
|
/* istanbul ignore else */
|
|
1822
2025
|
if (this.mediaConnection) {
|
|
2026
|
+
this.unregisterMediaConnectionListeners();
|
|
1823
2027
|
this.mediaConnection.close();
|
|
1824
2028
|
_Logger.default.info('Closing media channel', {
|
|
1825
2029
|
file: _constants.CALL_FILE,
|
|
@@ -1834,11 +2038,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1834
2038
|
});
|
|
1835
2039
|
case 5:
|
|
1836
2040
|
case "end":
|
|
1837
|
-
return
|
|
2041
|
+
return _context12.stop();
|
|
1838
2042
|
}
|
|
1839
|
-
},
|
|
2043
|
+
}, _callee12, this, [[1, 3]]);
|
|
1840
2044
|
}));
|
|
1841
|
-
function handleIncomingCallDisconnect(
|
|
2045
|
+
function handleIncomingCallDisconnect(_x0) {
|
|
1842
2046
|
return _handleIncomingCallDisconnect.apply(this, arguments);
|
|
1843
2047
|
}
|
|
1844
2048
|
return handleIncomingCallDisconnect;
|
|
@@ -1853,21 +2057,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1853
2057
|
}, {
|
|
1854
2058
|
key: "handleOutgoingCallDisconnect",
|
|
1855
2059
|
value: (function () {
|
|
1856
|
-
var _handleOutgoingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1857
|
-
var response,
|
|
1858
|
-
return _regenerator.default.wrap(function (
|
|
1859
|
-
while (1) switch (
|
|
2060
|
+
var _handleOutgoingCallDisconnect = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(event) {
|
|
2061
|
+
var response, _t1;
|
|
2062
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
2063
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1860
2064
|
case 0:
|
|
1861
2065
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1862
2066
|
file: _constants.CALL_FILE,
|
|
1863
2067
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
|
|
1864
2068
|
});
|
|
1865
2069
|
this.setDisconnectReason();
|
|
1866
|
-
|
|
1867
|
-
|
|
2070
|
+
_context13.prev = 1;
|
|
2071
|
+
_context13.next = 2;
|
|
1868
2072
|
return this.delete();
|
|
1869
2073
|
case 2:
|
|
1870
|
-
response =
|
|
2074
|
+
response = _context13.sent;
|
|
1871
2075
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1872
2076
|
file: _constants.CALL_FILE,
|
|
1873
2077
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
|
|
@@ -1876,11 +2080,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1876
2080
|
file: _constants.CALL_FILE,
|
|
1877
2081
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
|
|
1878
2082
|
});
|
|
1879
|
-
|
|
2083
|
+
_context13.next = 4;
|
|
1880
2084
|
break;
|
|
1881
2085
|
case 3:
|
|
1882
|
-
|
|
1883
|
-
|
|
2086
|
+
_context13.prev = 3;
|
|
2087
|
+
_t1 = _context13["catch"](1);
|
|
1884
2088
|
_Logger.default.warn('Failed to delete the call', {
|
|
1885
2089
|
file: _constants.CALL_FILE,
|
|
1886
2090
|
method: _constants.METHODS.HANDLE_OUTGOING_CALL_DISCONNECT
|
|
@@ -1903,6 +2107,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1903
2107
|
|
|
1904
2108
|
/* istanbul ignore else */
|
|
1905
2109
|
if (this.mediaConnection) {
|
|
2110
|
+
this.unregisterMediaConnectionListeners();
|
|
1906
2111
|
this.mediaConnection.close();
|
|
1907
2112
|
_Logger.default.info('Closing media channel', {
|
|
1908
2113
|
file: _constants.CALL_FILE,
|
|
@@ -1917,11 +2122,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1917
2122
|
});
|
|
1918
2123
|
case 5:
|
|
1919
2124
|
case "end":
|
|
1920
|
-
return
|
|
2125
|
+
return _context13.stop();
|
|
1921
2126
|
}
|
|
1922
|
-
},
|
|
2127
|
+
}, _callee13, this, [[1, 3]]);
|
|
1923
2128
|
}));
|
|
1924
|
-
function handleOutgoingCallDisconnect(
|
|
2129
|
+
function handleOutgoingCallDisconnect(_x1) {
|
|
1925
2130
|
return _handleOutgoingCallDisconnect.apply(this, arguments);
|
|
1926
2131
|
}
|
|
1927
2132
|
return handleOutgoingCallDisconnect;
|
|
@@ -1957,10 +2162,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1957
2162
|
}, {
|
|
1958
2163
|
key: "handleUnknownState",
|
|
1959
2164
|
value: (function () {
|
|
1960
|
-
var _handleUnknownState = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1961
|
-
var eventData, response,
|
|
1962
|
-
return _regenerator.default.wrap(function (
|
|
1963
|
-
while (1) switch (
|
|
2165
|
+
var _handleUnknownState = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(event) {
|
|
2166
|
+
var eventData, response, _t10;
|
|
2167
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
2168
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1964
2169
|
case 0:
|
|
1965
2170
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
1966
2171
|
file: _constants.CALL_FILE,
|
|
@@ -1981,21 +2186,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1981
2186
|
/* We need to clear the call at Mobius too. For delete failure
|
|
1982
2187
|
* error handling is not required
|
|
1983
2188
|
*/
|
|
1984
|
-
|
|
2189
|
+
_context14.prev = 1;
|
|
1985
2190
|
this.setDisconnectReason();
|
|
1986
|
-
|
|
2191
|
+
_context14.next = 2;
|
|
1987
2192
|
return this.delete();
|
|
1988
2193
|
case 2:
|
|
1989
|
-
response =
|
|
2194
|
+
response = _context14.sent;
|
|
1990
2195
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1991
2196
|
file: _constants.CALL_FILE,
|
|
1992
2197
|
method: _constants.METHODS.HANDLE_UNKNOWN_STATE
|
|
1993
2198
|
});
|
|
1994
|
-
|
|
2199
|
+
_context14.next = 4;
|
|
1995
2200
|
break;
|
|
1996
2201
|
case 3:
|
|
1997
|
-
|
|
1998
|
-
|
|
2202
|
+
_context14.prev = 3;
|
|
2203
|
+
_t10 = _context14["catch"](1);
|
|
1999
2204
|
_Logger.default.warn('Failed to delete the call', {
|
|
2000
2205
|
file: _constants.CALL_FILE,
|
|
2001
2206
|
method: _constants.METHODS.HANDLE_UNKNOWN_STATE
|
|
@@ -2011,6 +2216,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2011
2216
|
clearInterval(this.sessionTimer);
|
|
2012
2217
|
}
|
|
2013
2218
|
if (this.mediaConnection) {
|
|
2219
|
+
this.unregisterMediaConnectionListeners();
|
|
2014
2220
|
this.mediaConnection.close();
|
|
2015
2221
|
_Logger.default.info('Closing media channel', {
|
|
2016
2222
|
file: _constants.CALL_FILE,
|
|
@@ -2025,11 +2231,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2025
2231
|
});
|
|
2026
2232
|
case 5:
|
|
2027
2233
|
case "end":
|
|
2028
|
-
return
|
|
2234
|
+
return _context14.stop();
|
|
2029
2235
|
}
|
|
2030
|
-
},
|
|
2236
|
+
}, _callee14, this, [[1, 3]]);
|
|
2031
2237
|
}));
|
|
2032
|
-
function handleUnknownState(
|
|
2238
|
+
function handleUnknownState(_x10) {
|
|
2033
2239
|
return _handleUnknownState.apply(this, arguments);
|
|
2034
2240
|
}
|
|
2035
2241
|
return handleUnknownState;
|
|
@@ -2098,27 +2304,27 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2098
2304
|
}, {
|
|
2099
2305
|
key: "handleRoapEstablished",
|
|
2100
2306
|
value: (function () {
|
|
2101
|
-
var _handleRoapEstablished = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2307
|
+
var _handleRoapEstablished = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(context, event) {
|
|
2102
2308
|
var _this8 = this;
|
|
2103
|
-
var
|
|
2104
|
-
return _regenerator.default.wrap(function (
|
|
2105
|
-
while (1) switch (
|
|
2309
|
+
var _ref0, received, message, res, errData, _t11;
|
|
2310
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
2311
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
2106
2312
|
case 0:
|
|
2107
2313
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
2108
2314
|
file: _constants.CALL_FILE,
|
|
2109
2315
|
method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
|
|
2110
2316
|
});
|
|
2111
|
-
|
|
2317
|
+
_ref0 = event.data, received = _ref0.received, message = _ref0.message;
|
|
2112
2318
|
this.receivedRoapOKSeq = message.seq;
|
|
2113
2319
|
if (received) {
|
|
2114
|
-
|
|
2320
|
+
_context15.next = 5;
|
|
2115
2321
|
break;
|
|
2116
2322
|
}
|
|
2117
2323
|
_Logger.default.info('Sending Media Ok to the remote End', {
|
|
2118
2324
|
file: _constants.CALL_FILE,
|
|
2119
2325
|
method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
|
|
2120
2326
|
});
|
|
2121
|
-
|
|
2327
|
+
_context15.prev = 1;
|
|
2122
2328
|
if (this.callStateMachine.state.value === 'S_RECV_CALL_PROGRESS' || this.callStateMachine.state.value === 'S_SEND_CALL_SETUP') {
|
|
2123
2329
|
_Logger.default.info('Media negotiation completed before call connect. Setting media negotiation completed flag.', {
|
|
2124
2330
|
file: _constants.CALL_FILE,
|
|
@@ -2127,10 +2333,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2127
2333
|
this.mediaNegotiationCompleted = true;
|
|
2128
2334
|
}
|
|
2129
2335
|
message.seq = this.seq;
|
|
2130
|
-
|
|
2336
|
+
_context15.next = 2;
|
|
2131
2337
|
return this.postMedia(message);
|
|
2132
2338
|
case 2:
|
|
2133
|
-
res =
|
|
2339
|
+
res = _context15.sent;
|
|
2134
2340
|
_Logger.default.log("Response code: ".concat(res.statusCode), {
|
|
2135
2341
|
file: _constants.CALL_FILE,
|
|
2136
2342
|
method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
|
|
@@ -2141,16 +2347,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2141
2347
|
type: 'E_CALL_ESTABLISHED'
|
|
2142
2348
|
});
|
|
2143
2349
|
}
|
|
2144
|
-
|
|
2350
|
+
_context15.next = 4;
|
|
2145
2351
|
break;
|
|
2146
2352
|
case 3:
|
|
2147
|
-
|
|
2148
|
-
|
|
2353
|
+
_context15.prev = 3;
|
|
2354
|
+
_t11 = _context15["catch"](1);
|
|
2149
2355
|
_Logger.default.warn('Failed to process MediaOk request', {
|
|
2150
2356
|
file: _constants.CALL_FILE,
|
|
2151
2357
|
method: _constants.METHODS.HANDLE_ROAP_ESTABLISHED
|
|
2152
2358
|
});
|
|
2153
|
-
errData =
|
|
2359
|
+
errData = _t11;
|
|
2154
2360
|
(0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
|
|
2155
2361
|
/* Start retry if only it is a midcall case */
|
|
2156
2362
|
/* istanbul ignore else */
|
|
@@ -2163,14 +2369,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2163
2369
|
}, interval * 1000);
|
|
2164
2370
|
}
|
|
2165
2371
|
}, this.getCorrelationId(), errData, this.handleRoapEstablished.name, _constants.CALL_FILE);
|
|
2166
|
-
|
|
2372
|
+
_context15.next = 4;
|
|
2167
2373
|
return (0, _Utils.uploadLogs)({
|
|
2168
2374
|
correlationId: this.correlationId,
|
|
2169
2375
|
callId: this.callId,
|
|
2170
2376
|
broadworksCorrelationInfo: this.broadworksCorrelationInfo
|
|
2171
2377
|
});
|
|
2172
2378
|
case 4:
|
|
2173
|
-
|
|
2379
|
+
_context15.next = 6;
|
|
2174
2380
|
break;
|
|
2175
2381
|
case 5:
|
|
2176
2382
|
_Logger.default.info('Notifying internal-media-core about ROAP OK message', {
|
|
@@ -2204,11 +2410,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2204
2410
|
}
|
|
2205
2411
|
case 6:
|
|
2206
2412
|
case "end":
|
|
2207
|
-
return
|
|
2413
|
+
return _context15.stop();
|
|
2208
2414
|
}
|
|
2209
|
-
},
|
|
2415
|
+
}, _callee15, this, [[1, 3]]);
|
|
2210
2416
|
}));
|
|
2211
|
-
function handleRoapEstablished(
|
|
2417
|
+
function handleRoapEstablished(_x11, _x12) {
|
|
2212
2418
|
return _handleRoapEstablished.apply(this, arguments);
|
|
2213
2419
|
}
|
|
2214
2420
|
return handleRoapEstablished;
|
|
@@ -2223,11 +2429,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2223
2429
|
}, {
|
|
2224
2430
|
key: "handleRoapError",
|
|
2225
2431
|
value: (function () {
|
|
2226
|
-
var _handleRoapError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2432
|
+
var _handleRoapError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(context, event) {
|
|
2227
2433
|
var _this9 = this;
|
|
2228
|
-
var message, res, errData,
|
|
2229
|
-
return _regenerator.default.wrap(function (
|
|
2230
|
-
while (1) switch (
|
|
2434
|
+
var message, res, errData, _t12;
|
|
2435
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
2436
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
2231
2437
|
case 0:
|
|
2232
2438
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
2233
2439
|
file: _constants.CALL_FILE,
|
|
@@ -2238,28 +2444,28 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2238
2444
|
message = event.data;
|
|
2239
2445
|
/* istanbul ignore else */
|
|
2240
2446
|
if (!(message && message.messageType === 'ERROR')) {
|
|
2241
|
-
|
|
2447
|
+
_context16.next = 4;
|
|
2242
2448
|
break;
|
|
2243
2449
|
}
|
|
2244
|
-
|
|
2245
|
-
|
|
2450
|
+
_context16.prev = 1;
|
|
2451
|
+
_context16.next = 2;
|
|
2246
2452
|
return this.postMedia(message);
|
|
2247
2453
|
case 2:
|
|
2248
|
-
res =
|
|
2454
|
+
res = _context16.sent;
|
|
2249
2455
|
_Logger.default.info("Response code: ".concat(res.statusCode), {
|
|
2250
2456
|
file: _constants.CALL_FILE,
|
|
2251
2457
|
method: _constants.METHODS.HANDLE_ROAP_ERROR
|
|
2252
2458
|
});
|
|
2253
|
-
|
|
2459
|
+
_context16.next = 4;
|
|
2254
2460
|
break;
|
|
2255
2461
|
case 3:
|
|
2256
|
-
|
|
2257
|
-
|
|
2462
|
+
_context16.prev = 3;
|
|
2463
|
+
_t12 = _context16["catch"](1);
|
|
2258
2464
|
_Logger.default.warn('Failed to communicate ROAP error to Webex Calling', {
|
|
2259
2465
|
file: _constants.CALL_FILE,
|
|
2260
2466
|
method: _constants.METHODS.HANDLE_ROAP_ERROR
|
|
2261
2467
|
});
|
|
2262
|
-
errData =
|
|
2468
|
+
errData = _t12;
|
|
2263
2469
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
2264
2470
|
_this9.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
2265
2471
|
_this9.submitCallErrorMetric(error);
|
|
@@ -2269,7 +2475,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2269
2475
|
function (interval) {
|
|
2270
2476
|
return undefined;
|
|
2271
2477
|
}, this.getCorrelationId(), errData, this.handleRoapError.name, _constants.CALL_FILE);
|
|
2272
|
-
|
|
2478
|
+
_context16.next = 4;
|
|
2273
2479
|
return (0, _Utils.uploadLogs)({
|
|
2274
2480
|
correlationId: this.correlationId,
|
|
2275
2481
|
callId: this.callId,
|
|
@@ -2292,11 +2498,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2292
2498
|
}
|
|
2293
2499
|
case 5:
|
|
2294
2500
|
case "end":
|
|
2295
|
-
return
|
|
2501
|
+
return _context16.stop();
|
|
2296
2502
|
}
|
|
2297
|
-
},
|
|
2503
|
+
}, _callee16, this, [[1, 3]]);
|
|
2298
2504
|
}));
|
|
2299
|
-
function handleRoapError(
|
|
2505
|
+
function handleRoapError(_x13, _x14) {
|
|
2300
2506
|
return _handleRoapError.apply(this, arguments);
|
|
2301
2507
|
}
|
|
2302
2508
|
return handleRoapError;
|
|
@@ -2311,11 +2517,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2311
2517
|
}, {
|
|
2312
2518
|
key: "handleOutgoingRoapOffer",
|
|
2313
2519
|
value: (function () {
|
|
2314
|
-
var _handleOutgoingRoapOffer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2520
|
+
var _handleOutgoingRoapOffer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(context, event) {
|
|
2315
2521
|
var _this0 = this;
|
|
2316
|
-
var message, res, errData,
|
|
2317
|
-
return _regenerator.default.wrap(function (
|
|
2318
|
-
while (1) switch (
|
|
2522
|
+
var message, res, errData, _t13;
|
|
2523
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
2524
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
2319
2525
|
case 0:
|
|
2320
2526
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
2321
2527
|
file: _constants.CALL_FILE,
|
|
@@ -2323,7 +2529,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2323
2529
|
});
|
|
2324
2530
|
message = event.data;
|
|
2325
2531
|
if (message !== null && message !== void 0 && message.sdp) {
|
|
2326
|
-
|
|
2532
|
+
_context17.next = 1;
|
|
2327
2533
|
break;
|
|
2328
2534
|
}
|
|
2329
2535
|
_Logger.default.info('Initializing Offer...', {
|
|
@@ -2331,27 +2537,27 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2331
2537
|
method: _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER
|
|
2332
2538
|
});
|
|
2333
2539
|
this.mediaConnection.initiateOffer();
|
|
2334
|
-
return
|
|
2540
|
+
return _context17.abrupt("return");
|
|
2335
2541
|
case 1:
|
|
2336
|
-
|
|
2337
|
-
|
|
2542
|
+
_context17.prev = 1;
|
|
2543
|
+
_context17.next = 2;
|
|
2338
2544
|
return this.postMedia(message);
|
|
2339
2545
|
case 2:
|
|
2340
|
-
res =
|
|
2546
|
+
res = _context17.sent;
|
|
2341
2547
|
_Logger.default.log("Response code: ".concat(res.statusCode), {
|
|
2342
2548
|
file: _constants.CALL_FILE,
|
|
2343
2549
|
method: _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER
|
|
2344
2550
|
});
|
|
2345
|
-
|
|
2551
|
+
_context17.next = 4;
|
|
2346
2552
|
break;
|
|
2347
2553
|
case 3:
|
|
2348
|
-
|
|
2349
|
-
|
|
2554
|
+
_context17.prev = 3;
|
|
2555
|
+
_t13 = _context17["catch"](1);
|
|
2350
2556
|
_Logger.default.warn('Failed to send MediaOffer request', {
|
|
2351
2557
|
file: _constants.CALL_FILE,
|
|
2352
2558
|
method: _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER
|
|
2353
2559
|
});
|
|
2354
|
-
errData =
|
|
2560
|
+
errData = _t13;
|
|
2355
2561
|
(0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
|
|
2356
2562
|
/* Start retry if only it is a midcall case */
|
|
2357
2563
|
if (_this0.connected) {
|
|
@@ -2363,7 +2569,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2363
2569
|
}, interval * 1000);
|
|
2364
2570
|
}
|
|
2365
2571
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_ROAP_OFFER, _constants.CALL_FILE);
|
|
2366
|
-
|
|
2572
|
+
_context17.next = 4;
|
|
2367
2573
|
return (0, _Utils.uploadLogs)({
|
|
2368
2574
|
correlationId: this.correlationId,
|
|
2369
2575
|
callId: this.callId,
|
|
@@ -2371,11 +2577,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2371
2577
|
});
|
|
2372
2578
|
case 4:
|
|
2373
2579
|
case "end":
|
|
2374
|
-
return
|
|
2580
|
+
return _context17.stop();
|
|
2375
2581
|
}
|
|
2376
|
-
},
|
|
2582
|
+
}, _callee17, this, [[1, 3]]);
|
|
2377
2583
|
}));
|
|
2378
|
-
function handleOutgoingRoapOffer(
|
|
2584
|
+
function handleOutgoingRoapOffer(_x15, _x16) {
|
|
2379
2585
|
return _handleOutgoingRoapOffer.apply(this, arguments);
|
|
2380
2586
|
}
|
|
2381
2587
|
return handleOutgoingRoapOffer;
|
|
@@ -2390,37 +2596,37 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2390
2596
|
}, {
|
|
2391
2597
|
key: "handleOutgoingRoapAnswer",
|
|
2392
2598
|
value: (function () {
|
|
2393
|
-
var _handleOutgoingRoapAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2599
|
+
var _handleOutgoingRoapAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(context, event) {
|
|
2394
2600
|
var _this1 = this;
|
|
2395
|
-
var message, res, errData,
|
|
2396
|
-
return _regenerator.default.wrap(function (
|
|
2397
|
-
while (1) switch (
|
|
2601
|
+
var message, res, errData, _t14;
|
|
2602
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
2603
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
2398
2604
|
case 0:
|
|
2399
2605
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with: ").concat(this.getCorrelationId()), {
|
|
2400
2606
|
file: _constants.CALL_FILE,
|
|
2401
2607
|
method: _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER
|
|
2402
2608
|
});
|
|
2403
2609
|
message = event.data;
|
|
2404
|
-
|
|
2610
|
+
_context18.prev = 1;
|
|
2405
2611
|
message.seq = this.seq;
|
|
2406
|
-
|
|
2612
|
+
_context18.next = 2;
|
|
2407
2613
|
return this.postMedia(message);
|
|
2408
2614
|
case 2:
|
|
2409
|
-
res =
|
|
2615
|
+
res = _context18.sent;
|
|
2410
2616
|
_Logger.default.log("Response code: ".concat(res.statusCode), {
|
|
2411
2617
|
file: _constants.CALL_FILE,
|
|
2412
2618
|
method: _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER
|
|
2413
2619
|
});
|
|
2414
|
-
|
|
2620
|
+
_context18.next = 4;
|
|
2415
2621
|
break;
|
|
2416
2622
|
case 3:
|
|
2417
|
-
|
|
2418
|
-
|
|
2623
|
+
_context18.prev = 3;
|
|
2624
|
+
_t14 = _context18["catch"](1);
|
|
2419
2625
|
_Logger.default.warn('Failed to send MediaAnswer request', {
|
|
2420
2626
|
file: _constants.CALL_FILE,
|
|
2421
2627
|
method: _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER
|
|
2422
2628
|
});
|
|
2423
|
-
errData =
|
|
2629
|
+
errData = _t14;
|
|
2424
2630
|
(0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
|
|
2425
2631
|
/* Start retry if only it is a midcall case */
|
|
2426
2632
|
if (_this1.connected) {
|
|
@@ -2432,7 +2638,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2432
2638
|
}, interval * 1000);
|
|
2433
2639
|
}
|
|
2434
2640
|
}, this.getCorrelationId(), errData, _constants.METHODS.HANDLE_OUTGOING_ROAP_ANSWER, _constants.CALL_FILE);
|
|
2435
|
-
|
|
2641
|
+
_context18.next = 4;
|
|
2436
2642
|
return (0, _Utils.uploadLogs)({
|
|
2437
2643
|
correlationId: this.correlationId,
|
|
2438
2644
|
callId: this.callId,
|
|
@@ -2440,11 +2646,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2440
2646
|
});
|
|
2441
2647
|
case 4:
|
|
2442
2648
|
case "end":
|
|
2443
|
-
return
|
|
2649
|
+
return _context18.stop();
|
|
2444
2650
|
}
|
|
2445
|
-
},
|
|
2651
|
+
}, _callee18, this, [[1, 3]]);
|
|
2446
2652
|
}));
|
|
2447
|
-
function handleOutgoingRoapAnswer(
|
|
2653
|
+
function handleOutgoingRoapAnswer(_x17, _x18) {
|
|
2448
2654
|
return _handleOutgoingRoapAnswer.apply(this, arguments);
|
|
2449
2655
|
}
|
|
2450
2656
|
return handleOutgoingRoapAnswer;
|
|
@@ -2516,8 +2722,40 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2516
2722
|
}
|
|
2517
2723
|
}
|
|
2518
2724
|
}, {
|
|
2519
|
-
key: "
|
|
2520
|
-
value:
|
|
2725
|
+
key: "getIceCandidatesTimeout",
|
|
2726
|
+
value:
|
|
2727
|
+
/**
|
|
2728
|
+
* Determines the ICE candidate gathering timeout to use for the media connection.
|
|
2729
|
+
*
|
|
2730
|
+
* When the remote peer advertises itself as an ICE-lite agent (a=ice-lite) in its ROAP offer,
|
|
2731
|
+
* it only provides host candidates and does not perform connectivity checks, so there is no
|
|
2732
|
+
* need to wait the full ICE_CANDIDATES_TIMEOUT for local candidate gathering. In that case a
|
|
2733
|
+
* shorter timeout is returned to avoid stalling media negotiation for ~3 seconds.
|
|
2734
|
+
*
|
|
2735
|
+
* This optimization is opt-in: it only applies when the SDK is initialized with
|
|
2736
|
+
* `iceGathering.reduceTimeoutForIceLite` set to `true`. Otherwise the default
|
|
2737
|
+
* ICE_CANDIDATES_TIMEOUT is always used.
|
|
2738
|
+
*
|
|
2739
|
+
* @returns The ICE candidates timeout in milliseconds.
|
|
2740
|
+
*/
|
|
2741
|
+
function getIceCandidatesTimeout() {
|
|
2742
|
+
var _this$iceGatheringCon, _this$remoteRoapMessa2;
|
|
2743
|
+
if (!((_this$iceGatheringCon = this.iceGatheringConfig) !== null && _this$iceGatheringCon !== void 0 && _this$iceGatheringCon.reduceTimeoutForIceLite)) {
|
|
2744
|
+
return _constants.ICE_CANDIDATES_TIMEOUT;
|
|
2745
|
+
}
|
|
2746
|
+
var remoteSdp = (_this$remoteRoapMessa2 = this.remoteRoapMessage) === null || _this$remoteRoapMessa2 === void 0 ? void 0 : _this$remoteRoapMessa2.sdp;
|
|
2747
|
+
if (remoteSdp && /^a=ice-lite[\r\n]*$/im.test(remoteSdp)) {
|
|
2748
|
+
var _this$iceGatheringCon2;
|
|
2749
|
+
_Logger.default.info('Remote offer advertises ice-lite, using reduced ICE candidates timeout', {
|
|
2750
|
+
file: _constants.CALL_FILE,
|
|
2751
|
+
method: _constants.METHODS.INIT_MEDIA_CONNECTION
|
|
2752
|
+
});
|
|
2753
|
+
return (_this$iceGatheringCon2 = this.iceGatheringConfig.iceLiteTimeout) !== null && _this$iceGatheringCon2 !== void 0 ? _this$iceGatheringCon2 : _constants.ICE_LITE_CANDIDATES_TIMEOUT;
|
|
2754
|
+
}
|
|
2755
|
+
return _constants.ICE_CANDIDATES_TIMEOUT;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
/* istanbul ignore next */
|
|
2521
2759
|
/**
|
|
2522
2760
|
* Initialize Media Connection.
|
|
2523
2761
|
*
|
|
@@ -2525,12 +2763,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2525
2763
|
* @param settings.localAudioTrack - MediaStreamTrack.
|
|
2526
2764
|
* @param settings.debugId - String.
|
|
2527
2765
|
*/
|
|
2528
|
-
|
|
2766
|
+
}, {
|
|
2767
|
+
key: "initMediaConnection",
|
|
2768
|
+
value: function initMediaConnection(localAudioTrack, debugId) {
|
|
2529
2769
|
var _this10 = this;
|
|
2530
2770
|
var mediaConnection = new _internalMediaCore.RoapMediaConnection({
|
|
2531
2771
|
skipInactiveTransceivers: true,
|
|
2532
2772
|
iceServers: [],
|
|
2533
|
-
iceCandidatesTimeout:
|
|
2773
|
+
iceCandidatesTimeout: this.getIceCandidatesTimeout(),
|
|
2534
2774
|
sdpMunging: {
|
|
2535
2775
|
convertPort9to0: true,
|
|
2536
2776
|
addContentSlides: false,
|
|
@@ -2604,10 +2844,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2604
2844
|
* @param localAudioStream - The local audio stream for the call.
|
|
2605
2845
|
*/
|
|
2606
2846
|
function () {
|
|
2607
|
-
var _answer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2847
|
+
var _answer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(localAudioStream) {
|
|
2608
2848
|
var localAudioTrack;
|
|
2609
|
-
return _regenerator.default.wrap(function (
|
|
2610
|
-
while (1) switch (
|
|
2849
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
2850
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
2611
2851
|
case 0:
|
|
2612
2852
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with stream"), {
|
|
2613
2853
|
file: _constants.CALL_FILE,
|
|
@@ -2616,7 +2856,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2616
2856
|
this.localAudioStream = localAudioStream;
|
|
2617
2857
|
localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
|
|
2618
2858
|
if (localAudioTrack) {
|
|
2619
|
-
|
|
2859
|
+
_context19.next = 1;
|
|
2620
2860
|
break;
|
|
2621
2861
|
}
|
|
2622
2862
|
_Logger.default.warn("Did not find a local track while answering the call ".concat(this.getCorrelationId()), {
|
|
@@ -2627,13 +2867,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2627
2867
|
this.sendCallStateMachineEvt({
|
|
2628
2868
|
type: 'E_SEND_CALL_DISCONNECT'
|
|
2629
2869
|
});
|
|
2630
|
-
return
|
|
2870
|
+
return _context19.abrupt("return");
|
|
2631
2871
|
case 1:
|
|
2632
2872
|
localAudioTrack.enabled = true;
|
|
2633
2873
|
if (!this.mediaConnection) {
|
|
2634
2874
|
this.initMediaConnection(localAudioTrack);
|
|
2635
2875
|
this.mediaRoapEventsListener();
|
|
2636
2876
|
this.mediaTrackListener();
|
|
2877
|
+
this.mediaIceEventsListener();
|
|
2637
2878
|
this.registerListeners(localAudioStream);
|
|
2638
2879
|
}
|
|
2639
2880
|
if (this.callStateMachine.state.value === 'S_SEND_CALL_PROGRESS') {
|
|
@@ -2648,11 +2889,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2648
2889
|
}
|
|
2649
2890
|
case 2:
|
|
2650
2891
|
case "end":
|
|
2651
|
-
return
|
|
2892
|
+
return _context19.stop();
|
|
2652
2893
|
}
|
|
2653
|
-
},
|
|
2894
|
+
}, _callee19, this);
|
|
2654
2895
|
}));
|
|
2655
|
-
function answer(
|
|
2896
|
+
function answer(_x19) {
|
|
2656
2897
|
return _answer.apply(this, arguments);
|
|
2657
2898
|
}
|
|
2658
2899
|
return answer;
|
|
@@ -2665,10 +2906,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2665
2906
|
}, {
|
|
2666
2907
|
key: "dial",
|
|
2667
2908
|
value: (function () {
|
|
2668
|
-
var _dial = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2909
|
+
var _dial = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20(localAudioStream) {
|
|
2669
2910
|
var localAudioTrack;
|
|
2670
|
-
return _regenerator.default.wrap(function (
|
|
2671
|
-
while (1) switch (
|
|
2911
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
2912
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
2672
2913
|
case 0:
|
|
2673
2914
|
_Logger.default.info("".concat(_constants2.METHOD_START_MESSAGE, " with stream"), {
|
|
2674
2915
|
file: _constants.CALL_FILE,
|
|
@@ -2677,7 +2918,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2677
2918
|
this.localAudioStream = localAudioStream;
|
|
2678
2919
|
localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
|
|
2679
2920
|
if (localAudioTrack) {
|
|
2680
|
-
|
|
2921
|
+
_context20.next = 1;
|
|
2681
2922
|
break;
|
|
2682
2923
|
}
|
|
2683
2924
|
_Logger.default.warn("Did not find a local track while dialing the call ".concat(this.getCorrelationId()), {
|
|
@@ -2686,13 +2927,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2686
2927
|
});
|
|
2687
2928
|
this.deleteCb(this.getCorrelationId());
|
|
2688
2929
|
this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());
|
|
2689
|
-
return
|
|
2930
|
+
return _context20.abrupt("return");
|
|
2690
2931
|
case 1:
|
|
2691
2932
|
localAudioTrack.enabled = true;
|
|
2692
2933
|
if (!this.mediaConnection) {
|
|
2693
2934
|
this.initMediaConnection(localAudioTrack);
|
|
2694
2935
|
this.mediaRoapEventsListener();
|
|
2695
2936
|
this.mediaTrackListener();
|
|
2937
|
+
this.mediaIceEventsListener();
|
|
2696
2938
|
this.registerListeners(localAudioStream);
|
|
2697
2939
|
}
|
|
2698
2940
|
if (this.mediaStateMachine.state.value === 'S_ROAP_IDLE') {
|
|
@@ -2707,11 +2949,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2707
2949
|
}
|
|
2708
2950
|
case 2:
|
|
2709
2951
|
case "end":
|
|
2710
|
-
return
|
|
2952
|
+
return _context20.stop();
|
|
2711
2953
|
}
|
|
2712
|
-
},
|
|
2954
|
+
}, _callee20, this);
|
|
2713
2955
|
}));
|
|
2714
|
-
function dial(
|
|
2956
|
+
function dial(_x20) {
|
|
2715
2957
|
return _dial.apply(this, arguments);
|
|
2716
2958
|
}
|
|
2717
2959
|
return dial;
|
|
@@ -2725,17 +2967,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2725
2967
|
* @param state -.
|
|
2726
2968
|
*/
|
|
2727
2969
|
function () {
|
|
2728
|
-
var _patch = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2729
|
-
return _regenerator.default.wrap(function (
|
|
2730
|
-
while (1) switch (
|
|
2970
|
+
var _patch = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21(state) {
|
|
2971
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
2972
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
2731
2973
|
case 0:
|
|
2732
2974
|
_Logger.default.info("Send a PATCH for ".concat(state, " to Webex Calling"), {
|
|
2733
2975
|
file: _constants.CALL_FILE,
|
|
2734
2976
|
method: 'patch'
|
|
2735
2977
|
});
|
|
2736
|
-
return
|
|
2737
|
-
// Sample uri: http://localhost/api/v1/calling/web/devices/{deviceid}/calls/{callid}
|
|
2738
|
-
|
|
2978
|
+
return _context21.abrupt("return", this.apiRequest.makeRequest({
|
|
2739
2979
|
uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId),
|
|
2740
2980
|
method: _types2.HTTP_METHODS.PATCH,
|
|
2741
2981
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -2752,11 +2992,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2752
2992
|
}));
|
|
2753
2993
|
case 1:
|
|
2754
2994
|
case "end":
|
|
2755
|
-
return
|
|
2995
|
+
return _context21.stop();
|
|
2756
2996
|
}
|
|
2757
|
-
},
|
|
2997
|
+
}, _callee21, this);
|
|
2758
2998
|
}));
|
|
2759
|
-
function patch(
|
|
2999
|
+
function patch(_x21) {
|
|
2760
3000
|
return _patch.apply(this, arguments);
|
|
2761
3001
|
}
|
|
2762
3002
|
return patch;
|
|
@@ -2771,10 +3011,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2771
3011
|
}, {
|
|
2772
3012
|
key: "postSSRequest",
|
|
2773
3013
|
value: (function () {
|
|
2774
|
-
var _postSSRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2775
|
-
var request, transferContext,
|
|
2776
|
-
return _regenerator.default.wrap(function (
|
|
2777
|
-
while (1) switch (
|
|
3014
|
+
var _postSSRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(context, type) {
|
|
3015
|
+
var request, transferContext, _t15;
|
|
3016
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
3017
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
2778
3018
|
case 0:
|
|
2779
3019
|
request = {
|
|
2780
3020
|
uri: "".concat(this.mobiusUrl).concat(_constants2.SERVICES_ENDPOINT),
|
|
@@ -2789,15 +3029,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2789
3029
|
callId: this.callId
|
|
2790
3030
|
}
|
|
2791
3031
|
};
|
|
2792
|
-
|
|
2793
|
-
|
|
3032
|
+
_t15 = type;
|
|
3033
|
+
_context22.next = _t15 === _types3.SUPPLEMENTARY_SERVICES.HOLD ? 1 : _t15 === _types3.SUPPLEMENTARY_SERVICES.RESUME ? 2 : _t15 === _types3.SUPPLEMENTARY_SERVICES.TRANSFER ? 3 : 4;
|
|
2794
3034
|
break;
|
|
2795
3035
|
case 1:
|
|
2796
3036
|
request.uri = "".concat(request.uri, "/").concat(_constants.CALL_HOLD_SERVICE, "/").concat(_constants.HOLD_ENDPOINT);
|
|
2797
|
-
return
|
|
3037
|
+
return _context22.abrupt("continue", 5);
|
|
2798
3038
|
case 2:
|
|
2799
3039
|
request.uri = "".concat(request.uri, "/").concat(_constants.CALL_HOLD_SERVICE, "/").concat(_constants.RESUME_ENDPOINT);
|
|
2800
|
-
return
|
|
3040
|
+
return _context22.abrupt("continue", 5);
|
|
2801
3041
|
case 3:
|
|
2802
3042
|
request.uri = "".concat(request.uri, "/").concat(_constants.CALL_TRANSFER_SERVICE, "/").concat(_constants.TRANSFER_ENDPOINT);
|
|
2803
3043
|
transferContext = context;
|
|
@@ -2816,21 +3056,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2816
3056
|
transferType: _types4.TransferType.CONSULT
|
|
2817
3057
|
});
|
|
2818
3058
|
}
|
|
2819
|
-
return
|
|
3059
|
+
return _context22.abrupt("continue", 5);
|
|
2820
3060
|
case 4:
|
|
2821
3061
|
_Logger.default.warn("Unknown type for PUT request: ".concat(type), {
|
|
2822
3062
|
file: _constants.CALL_FILE,
|
|
2823
3063
|
method: _constants.METHODS.POST_SS_REQUEST
|
|
2824
3064
|
});
|
|
2825
3065
|
case 5:
|
|
2826
|
-
return
|
|
3066
|
+
return _context22.abrupt("return", this.apiRequest.makeRequest(request));
|
|
2827
3067
|
case 6:
|
|
2828
3068
|
case "end":
|
|
2829
|
-
return
|
|
3069
|
+
return _context22.stop();
|
|
2830
3070
|
}
|
|
2831
|
-
},
|
|
3071
|
+
}, _callee22, this);
|
|
2832
3072
|
}));
|
|
2833
|
-
function postSSRequest(
|
|
3073
|
+
function postSSRequest(_x22, _x23) {
|
|
2834
3074
|
return _postSSRequest.apply(this, arguments);
|
|
2835
3075
|
}
|
|
2836
3076
|
return postSSRequest;
|
|
@@ -2842,11 +3082,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2842
3082
|
}, {
|
|
2843
3083
|
key: "postStatus",
|
|
2844
3084
|
value: (function () {
|
|
2845
|
-
var _postStatus = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2846
|
-
return _regenerator.default.wrap(function (
|
|
2847
|
-
while (1) switch (
|
|
3085
|
+
var _postStatus = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
3086
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
3087
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2848
3088
|
case 0:
|
|
2849
|
-
return
|
|
3089
|
+
return _context23.abrupt("return", this.apiRequest.makeRequest({
|
|
2850
3090
|
uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId, "/").concat(_constants.CALL_STATUS_RESOURCE),
|
|
2851
3091
|
method: _types2.HTTP_METHODS.POST,
|
|
2852
3092
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -2861,9 +3101,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2861
3101
|
}));
|
|
2862
3102
|
case 1:
|
|
2863
3103
|
case "end":
|
|
2864
|
-
return
|
|
3104
|
+
return _context23.stop();
|
|
2865
3105
|
}
|
|
2866
|
-
},
|
|
3106
|
+
}, _callee23, this);
|
|
2867
3107
|
}));
|
|
2868
3108
|
function postStatus() {
|
|
2869
3109
|
return _postStatus.apply(this, arguments);
|
|
@@ -2882,14 +3122,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2882
3122
|
}, {
|
|
2883
3123
|
key: "completeTransfer",
|
|
2884
3124
|
value: (function () {
|
|
2885
|
-
var _completeTransfer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3125
|
+
var _completeTransfer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(transferType, transferCallId, transferTarget) {
|
|
2886
3126
|
var _this11 = this;
|
|
2887
|
-
var context, errData,
|
|
2888
|
-
return _regenerator.default.wrap(function (
|
|
2889
|
-
while (1) switch (
|
|
3127
|
+
var context, errData, _context24, _errData, _t16, _t17;
|
|
3128
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
3129
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2890
3130
|
case 0:
|
|
2891
3131
|
if (!(transferType === _types4.TransferType.BLIND && transferTarget)) {
|
|
2892
|
-
|
|
3132
|
+
_context25.next = 5;
|
|
2893
3133
|
break;
|
|
2894
3134
|
}
|
|
2895
3135
|
/* blind transfer */
|
|
@@ -2902,8 +3142,8 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2902
3142
|
transferorCallId: this.getCallId(),
|
|
2903
3143
|
destination: transferTarget
|
|
2904
3144
|
};
|
|
2905
|
-
|
|
2906
|
-
|
|
3145
|
+
_context25.prev = 1;
|
|
3146
|
+
_context25.next = 2;
|
|
2907
3147
|
return this.postSSRequest(context, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
|
|
2908
3148
|
case 2:
|
|
2909
3149
|
_Logger.default.info("Blind Transfer completed for correlationId ".concat(this.getCorrelationId()), {
|
|
@@ -2911,16 +3151,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2911
3151
|
method: _constants.METHODS.COMPLETE_TRANSFER
|
|
2912
3152
|
});
|
|
2913
3153
|
this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL, _types5.TRANSFER_ACTION.BLIND, _types5.METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
|
|
2914
|
-
|
|
3154
|
+
_context25.next = 4;
|
|
2915
3155
|
break;
|
|
2916
3156
|
case 3:
|
|
2917
|
-
|
|
2918
|
-
|
|
3157
|
+
_context25.prev = 3;
|
|
3158
|
+
_t16 = _context25["catch"](1);
|
|
2919
3159
|
_Logger.default.warn("Blind Transfer failed for correlationId ".concat(this.getCorrelationId()), {
|
|
2920
3160
|
file: _constants.CALL_FILE,
|
|
2921
3161
|
method: _constants.METHODS.COMPLETE_TRANSFER
|
|
2922
3162
|
});
|
|
2923
|
-
errData =
|
|
3163
|
+
errData = _t16;
|
|
2924
3164
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
2925
3165
|
_this11.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
|
|
2926
3166
|
_this11.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.BLIND);
|
|
@@ -2930,18 +3170,18 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2930
3170
|
function (interval) {
|
|
2931
3171
|
return undefined;
|
|
2932
3172
|
}, this.getCorrelationId(), errData, _constants.METHODS.COMPLETE_TRANSFER, _constants.CALL_FILE);
|
|
2933
|
-
|
|
3173
|
+
_context25.next = 4;
|
|
2934
3174
|
return (0, _Utils.uploadLogs)({
|
|
2935
3175
|
correlationId: this.correlationId,
|
|
2936
3176
|
callId: this.callId,
|
|
2937
3177
|
broadworksCorrelationInfo: this.broadworksCorrelationInfo
|
|
2938
3178
|
});
|
|
2939
3179
|
case 4:
|
|
2940
|
-
|
|
3180
|
+
_context25.next = 11;
|
|
2941
3181
|
break;
|
|
2942
3182
|
case 5:
|
|
2943
3183
|
if (!(transferType === _types4.TransferType.CONSULT && transferCallId)) {
|
|
2944
|
-
|
|
3184
|
+
_context25.next = 10;
|
|
2945
3185
|
break;
|
|
2946
3186
|
}
|
|
2947
3187
|
/* Consult transfer */
|
|
@@ -2950,29 +3190,29 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2950
3190
|
file: _constants.CALL_FILE,
|
|
2951
3191
|
method: _constants.METHODS.COMPLETE_TRANSFER
|
|
2952
3192
|
});
|
|
2953
|
-
|
|
3193
|
+
_context24 = {
|
|
2954
3194
|
transferorCallId: this.getCallId(),
|
|
2955
3195
|
transferToCallId: transferCallId
|
|
2956
3196
|
};
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
return this.postSSRequest(
|
|
3197
|
+
_context25.prev = 6;
|
|
3198
|
+
_context25.next = 7;
|
|
3199
|
+
return this.postSSRequest(_context24, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
|
|
2960
3200
|
case 7:
|
|
2961
3201
|
_Logger.default.info("Consult Transfer completed for correlationId ".concat(this.getCorrelationId()), {
|
|
2962
3202
|
file: _constants.CALL_FILE,
|
|
2963
3203
|
method: _constants.METHODS.COMPLETE_TRANSFER
|
|
2964
3204
|
});
|
|
2965
3205
|
this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL, _types5.TRANSFER_ACTION.CONSULT, _types5.METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
|
|
2966
|
-
|
|
3206
|
+
_context25.next = 9;
|
|
2967
3207
|
break;
|
|
2968
3208
|
case 8:
|
|
2969
|
-
|
|
2970
|
-
|
|
3209
|
+
_context25.prev = 8;
|
|
3210
|
+
_t17 = _context25["catch"](6);
|
|
2971
3211
|
_Logger.default.warn("Consult Transfer failed for correlationId ".concat(this.getCorrelationId()), {
|
|
2972
3212
|
file: _constants.CALL_FILE,
|
|
2973
3213
|
method: _constants.METHODS.COMPLETE_TRANSFER
|
|
2974
3214
|
});
|
|
2975
|
-
_errData =
|
|
3215
|
+
_errData = _t17;
|
|
2976
3216
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
2977
3217
|
_this11.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
|
|
2978
3218
|
_this11.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.CONSULT);
|
|
@@ -2982,14 +3222,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2982
3222
|
function (interval) {
|
|
2983
3223
|
return undefined;
|
|
2984
3224
|
}, this.getCorrelationId(), _errData, _constants.METHODS.COMPLETE_TRANSFER, _constants.CALL_FILE);
|
|
2985
|
-
|
|
3225
|
+
_context25.next = 9;
|
|
2986
3226
|
return (0, _Utils.uploadLogs)({
|
|
2987
3227
|
correlationId: this.correlationId,
|
|
2988
3228
|
callId: this.callId,
|
|
2989
3229
|
broadworksCorrelationInfo: this.broadworksCorrelationInfo
|
|
2990
3230
|
});
|
|
2991
3231
|
case 9:
|
|
2992
|
-
|
|
3232
|
+
_context25.next = 11;
|
|
2993
3233
|
break;
|
|
2994
3234
|
case 10:
|
|
2995
3235
|
_Logger.default.warn("Invalid information received, transfer failed for correlationId: ".concat(this.getCorrelationId()), {
|
|
@@ -2998,11 +3238,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2998
3238
|
});
|
|
2999
3239
|
case 11:
|
|
3000
3240
|
case "end":
|
|
3001
|
-
return
|
|
3241
|
+
return _context25.stop();
|
|
3002
3242
|
}
|
|
3003
|
-
},
|
|
3243
|
+
}, _callee24, this, [[1, 3], [6, 8]]);
|
|
3004
3244
|
}));
|
|
3005
|
-
function completeTransfer(
|
|
3245
|
+
function completeTransfer(_x24, _x25, _x26) {
|
|
3006
3246
|
return _completeTransfer.apply(this, arguments);
|
|
3007
3247
|
}
|
|
3008
3248
|
return completeTransfer;
|
|
@@ -3014,32 +3254,32 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3014
3254
|
}, {
|
|
3015
3255
|
key: "getCallStats",
|
|
3016
3256
|
value: (function () {
|
|
3017
|
-
var _getCallStats = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3018
|
-
var stats,
|
|
3019
|
-
return _regenerator.default.wrap(function (
|
|
3020
|
-
while (1) switch (
|
|
3257
|
+
var _getCallStats = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
3258
|
+
var stats, _t18;
|
|
3259
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
3260
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
3021
3261
|
case 0:
|
|
3022
|
-
|
|
3023
|
-
|
|
3262
|
+
_context26.prev = 0;
|
|
3263
|
+
_context26.next = 1;
|
|
3024
3264
|
return this.mediaConnection.getStats();
|
|
3025
3265
|
case 1:
|
|
3026
|
-
stats =
|
|
3027
|
-
|
|
3266
|
+
stats = _context26.sent;
|
|
3267
|
+
_context26.next = 3;
|
|
3028
3268
|
break;
|
|
3029
3269
|
case 2:
|
|
3030
|
-
|
|
3031
|
-
|
|
3270
|
+
_context26.prev = 2;
|
|
3271
|
+
_t18 = _context26["catch"](0);
|
|
3032
3272
|
_Logger.default.warn('Stats collection failed, using dummy stats', {
|
|
3033
3273
|
file: _constants.CALL_FILE,
|
|
3034
3274
|
method: _constants.METHODS.GET_CALL_STATS
|
|
3035
3275
|
});
|
|
3036
3276
|
case 3:
|
|
3037
|
-
return
|
|
3277
|
+
return _context26.abrupt("return", (0, _Utils.parseMediaQualityStatistics)(stats));
|
|
3038
3278
|
case 4:
|
|
3039
3279
|
case "end":
|
|
3040
|
-
return
|
|
3280
|
+
return _context26.stop();
|
|
3041
3281
|
}
|
|
3042
|
-
},
|
|
3282
|
+
}, _callee25, this, [[0, 2]]);
|
|
3043
3283
|
}));
|
|
3044
3284
|
function getCallStats() {
|
|
3045
3285
|
return _getCallStats.apply(this, arguments);
|
|
@@ -3055,15 +3295,17 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3055
3295
|
}, {
|
|
3056
3296
|
key: "postMedia",
|
|
3057
3297
|
value: (function () {
|
|
3058
|
-
var _postMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
3059
|
-
|
|
3060
|
-
|
|
3298
|
+
var _postMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(roapMessage) {
|
|
3299
|
+
var hostIps;
|
|
3300
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
3301
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
3061
3302
|
case 0:
|
|
3062
3303
|
_Logger.default.log('Posting message to Webex Calling', {
|
|
3063
3304
|
file: _constants.CALL_FILE,
|
|
3064
3305
|
method: _constants.METHODS.POST_MEDIA
|
|
3065
3306
|
});
|
|
3066
|
-
|
|
3307
|
+
hostIps = (0, _callUtils.getHostIpsFromSdp)(roapMessage === null || roapMessage === void 0 ? void 0 : roapMessage.sdp);
|
|
3308
|
+
return _context27.abrupt("return", this.apiRequest.makeRequest({
|
|
3067
3309
|
uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId, "/").concat(_constants.MEDIA_ENDPOINT_RESOURCE),
|
|
3068
3310
|
method: _types2.HTTP_METHODS.POST,
|
|
3069
3311
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -3077,16 +3319,17 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3077
3319
|
localMedia: {
|
|
3078
3320
|
roap: roapMessage,
|
|
3079
3321
|
mediaId: (0, _uuid.v4)()
|
|
3080
|
-
}
|
|
3322
|
+
},
|
|
3323
|
+
hostIps: hostIps
|
|
3081
3324
|
}
|
|
3082
3325
|
}));
|
|
3083
3326
|
case 1:
|
|
3084
3327
|
case "end":
|
|
3085
|
-
return
|
|
3328
|
+
return _context27.stop();
|
|
3086
3329
|
}
|
|
3087
|
-
},
|
|
3330
|
+
}, _callee26, this);
|
|
3088
3331
|
}));
|
|
3089
|
-
function postMedia(
|
|
3332
|
+
function postMedia(_x27) {
|
|
3090
3333
|
return _postMedia.apply(this, arguments);
|
|
3091
3334
|
}
|
|
3092
3335
|
return postMedia;
|
|
@@ -3099,90 +3342,8 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3099
3342
|
}, {
|
|
3100
3343
|
key: "mediaRoapEventsListener",
|
|
3101
3344
|
value: function mediaRoapEventsListener() {
|
|
3102
|
-
|
|
3103
|
-
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.
|
|
3104
|
-
/*#__PURE__*/
|
|
3105
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3106
|
-
function () {
|
|
3107
|
-
var _ref0 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(event) {
|
|
3108
|
-
var _event$roapMessage, _event$roapMessage2;
|
|
3109
|
-
var mediaOk, sdpVideoPortZero, _t18;
|
|
3110
|
-
return _regenerator.default.wrap(function (_context27) {
|
|
3111
|
-
while (1) switch (_context27.prev = _context27.next) {
|
|
3112
|
-
case 0:
|
|
3113
|
-
_Logger.default.info("ROAP message to send (rcv from MEDIA-SDK) :\n \n type: ".concat((_event$roapMessage = event.roapMessage) === null || _event$roapMessage === void 0 ? void 0 : _event$roapMessage.messageType, ", seq: ").concat(event.roapMessage.seq, " , version: ").concat(event.roapMessage.version), {
|
|
3114
|
-
file: _constants.CALL_FILE,
|
|
3115
|
-
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
3116
|
-
});
|
|
3117
|
-
_Logger.default.info("SDP message to send : \n ".concat((_event$roapMessage2 = event.roapMessage) === null || _event$roapMessage2 === void 0 ? void 0 : _event$roapMessage2.sdp), {
|
|
3118
|
-
file: _constants.CALL_FILE,
|
|
3119
|
-
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
3120
|
-
});
|
|
3121
|
-
_t18 = event.roapMessage.messageType;
|
|
3122
|
-
_context27.next = _t18 === _types4.RoapScenario.OK ? 1 : _t18 === _types4.RoapScenario.OFFER ? 2 : _t18 === _types4.RoapScenario.ANSWER ? 3 : _t18 === _types4.RoapScenario.ERROR ? 4 : _t18 === _types4.RoapScenario.OFFER_RESPONSE ? 5 : 6;
|
|
3123
|
-
break;
|
|
3124
|
-
case 1:
|
|
3125
|
-
mediaOk = {
|
|
3126
|
-
received: false,
|
|
3127
|
-
message: event.roapMessage
|
|
3128
|
-
};
|
|
3129
|
-
_this12.sendMediaStateMachineEvt({
|
|
3130
|
-
type: 'E_ROAP_OK',
|
|
3131
|
-
data: mediaOk
|
|
3132
|
-
});
|
|
3133
|
-
return _context27.abrupt("continue", 6);
|
|
3134
|
-
case 2:
|
|
3135
|
-
// TODO: Remove these after the Media-Core adds the fix
|
|
3136
|
-
// Check if at least one IPv6 "c=" line is present
|
|
3137
|
-
_Logger.default.info("before modifying sdp: ".concat(event.roapMessage.sdp), {
|
|
3138
|
-
file: _constants.CALL_FILE,
|
|
3139
|
-
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
3140
|
-
});
|
|
3141
|
-
event.roapMessage.sdp = (0, _Utils.modifySdpForIPv4)(event.roapMessage.sdp);
|
|
3142
|
-
sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\d+) /gim, 'm=$1 0 ');
|
|
3143
|
-
_Logger.default.info("after modification sdp: ".concat(sdpVideoPortZero), {
|
|
3144
|
-
file: _constants.CALL_FILE,
|
|
3145
|
-
method: _constants.METHODS.MEDIA_ROAP_EVENTS_LISTENER
|
|
3146
|
-
});
|
|
3147
|
-
event.roapMessage.sdp = sdpVideoPortZero;
|
|
3148
|
-
_this12.localRoapMessage = event.roapMessage;
|
|
3149
|
-
_this12.sendCallStateMachineEvt({
|
|
3150
|
-
type: 'E_SEND_CALL_SETUP',
|
|
3151
|
-
data: event.roapMessage
|
|
3152
|
-
});
|
|
3153
|
-
return _context27.abrupt("continue", 6);
|
|
3154
|
-
case 3:
|
|
3155
|
-
event.roapMessage.sdp = (0, _Utils.modifySdpForIPv4)(event.roapMessage.sdp);
|
|
3156
|
-
_this12.localRoapMessage = event.roapMessage;
|
|
3157
|
-
_this12.sendMediaStateMachineEvt({
|
|
3158
|
-
type: 'E_SEND_ROAP_ANSWER',
|
|
3159
|
-
data: event.roapMessage
|
|
3160
|
-
});
|
|
3161
|
-
return _context27.abrupt("continue", 6);
|
|
3162
|
-
case 4:
|
|
3163
|
-
_this12.sendMediaStateMachineEvt({
|
|
3164
|
-
type: 'E_ROAP_ERROR',
|
|
3165
|
-
data: event.roapMessage
|
|
3166
|
-
});
|
|
3167
|
-
return _context27.abrupt("continue", 6);
|
|
3168
|
-
case 5:
|
|
3169
|
-
event.roapMessage.sdp = (0, _Utils.modifySdpForIPv4)(event.roapMessage.sdp);
|
|
3170
|
-
_this12.localRoapMessage = event.roapMessage;
|
|
3171
|
-
_this12.sendMediaStateMachineEvt({
|
|
3172
|
-
type: 'E_SEND_ROAP_OFFER',
|
|
3173
|
-
data: event.roapMessage
|
|
3174
|
-
});
|
|
3175
|
-
return _context27.abrupt("continue", 6);
|
|
3176
|
-
case 6:
|
|
3177
|
-
case "end":
|
|
3178
|
-
return _context27.stop();
|
|
3179
|
-
}
|
|
3180
|
-
}, _callee26);
|
|
3181
|
-
}));
|
|
3182
|
-
return function (_x27) {
|
|
3183
|
-
return _ref0.apply(this, arguments);
|
|
3184
|
-
};
|
|
3185
|
-
}());
|
|
3345
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, this.handleMediaRoapEvent);
|
|
3346
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_FAILURE, this.handleRoapFailure);
|
|
3186
3347
|
}
|
|
3187
3348
|
|
|
3188
3349
|
/* istanbul ignore next */
|
|
@@ -3192,13 +3353,34 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3192
3353
|
}, {
|
|
3193
3354
|
key: "mediaTrackListener",
|
|
3194
3355
|
value: function mediaTrackListener() {
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3356
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.REMOTE_TRACK_ADDED, this.handleRemoteTrackAdded);
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
/* istanbul ignore next */
|
|
3360
|
+
/**
|
|
3361
|
+
* Setup listeners for ICE-related media connection events.
|
|
3362
|
+
*/
|
|
3363
|
+
}, {
|
|
3364
|
+
key: "mediaIceEventsListener",
|
|
3365
|
+
value: function mediaIceEventsListener() {
|
|
3366
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED, this.handleIceGatheringStateChanged);
|
|
3367
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED, this.handlePeerConnectionStateChanged);
|
|
3368
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED, this.handleIceConnectionStateChanged);
|
|
3369
|
+
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, this.handleIceCandidateError);
|
|
3370
|
+
}
|
|
3371
|
+
}, {
|
|
3372
|
+
key: "unregisterMediaConnectionListeners",
|
|
3373
|
+
value: function unregisterMediaConnectionListeners() {
|
|
3374
|
+
if (!this.mediaConnection || typeof this.mediaConnection.off !== 'function') {
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3377
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, this.handleMediaRoapEvent);
|
|
3378
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.ROAP_FAILURE, this.handleRoapFailure);
|
|
3379
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.REMOTE_TRACK_ADDED, this.handleRemoteTrackAdded);
|
|
3380
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.ICE_GATHERING_STATE_CHANGED, this.handleIceGatheringStateChanged);
|
|
3381
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED, this.handlePeerConnectionStateChanged);
|
|
3382
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.ICE_CONNECTION_STATE_CHANGED, this.handleIceConnectionStateChanged);
|
|
3383
|
+
this.mediaConnection.off(_internalMediaCore.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, this.handleIceCandidateError);
|
|
3202
3384
|
}
|
|
3203
3385
|
}, {
|
|
3204
3386
|
key: "unregisterListeners",
|
|
@@ -3239,7 +3421,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3239
3421
|
return this.getCallStats();
|
|
3240
3422
|
case 1:
|
|
3241
3423
|
disconnectMetrics = _context28.sent;
|
|
3242
|
-
return _context28.abrupt("return", this.
|
|
3424
|
+
return _context28.abrupt("return", this.apiRequest.makeRequest({
|
|
3243
3425
|
uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId),
|
|
3244
3426
|
method: _types2.HTTP_METHODS.DELETE,
|
|
3245
3427
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -3249,7 +3431,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3249
3431
|
deviceId: this.deviceId,
|
|
3250
3432
|
correlationId: this.correlationId
|
|
3251
3433
|
},
|
|
3252
|
-
callId: this.callId,
|
|
3434
|
+
callId: this.callId.includes(_constants.DEFAULT_LOCAL_CALL_ID) ? this.callId.replace("".concat(_constants.DEFAULT_LOCAL_CALL_ID, "_"), '') : this.callId,
|
|
3253
3435
|
metrics: disconnectMetrics,
|
|
3254
3436
|
causecode: this.disconnectReason.code,
|
|
3255
3437
|
cause: this.disconnectReason.cause
|
|
@@ -3277,8 +3459,8 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3277
3459
|
if (error.getCallError().errorLayer === _types.ERROR_LAYER.CALL_CONTROL) {
|
|
3278
3460
|
this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL_ERROR, transferMetricAction || this.callStateMachine.state.value.toString(), _types5.METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, error);
|
|
3279
3461
|
} else {
|
|
3280
|
-
var _this$
|
|
3281
|
-
this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA_ERROR, this.mediaStateMachine.state.value.toString(), _types5.METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, this.localRoapMessage.sdp, (_this$
|
|
3462
|
+
var _this$remoteRoapMessa3;
|
|
3463
|
+
this.metricManager.submitMediaMetric(_types5.METRIC_EVENT.MEDIA_ERROR, this.mediaStateMachine.state.value.toString(), _types5.METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, this.localRoapMessage.sdp, (_this$remoteRoapMessa3 = this.remoteRoapMessage) === null || _this$remoteRoapMessa3 === void 0 ? void 0 : _this$remoteRoapMessa3.sdp, undefined, error);
|
|
3282
3464
|
}
|
|
3283
3465
|
}
|
|
3284
3466
|
|
|
@@ -3467,6 +3649,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3467
3649
|
}
|
|
3468
3650
|
return handleTimeout;
|
|
3469
3651
|
}())
|
|
3652
|
+
}], [{
|
|
3653
|
+
key: "getPeerConnectionStateFromEvent",
|
|
3654
|
+
value: function getPeerConnectionStateFromEvent(event, preferredKey) {
|
|
3655
|
+
return event[preferredKey] || event.state || 'unknown';
|
|
3656
|
+
}
|
|
3470
3657
|
}]);
|
|
3471
3658
|
}(_impl.Eventing);
|
|
3472
3659
|
/**
|
|
@@ -3480,7 +3667,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3480
3667
|
* @param indicator - Service Indicator.
|
|
3481
3668
|
* @param dest -.
|
|
3482
3669
|
*/
|
|
3483
|
-
var createCall = exports.createCall = function createCall(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest) {
|
|
3484
|
-
return new Call(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest);
|
|
3670
|
+
var createCall = exports.createCall = function createCall(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest, iceGatheringConfig) {
|
|
3671
|
+
return new Call(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest, iceGatheringConfig);
|
|
3485
3672
|
};
|
|
3486
3673
|
//# sourceMappingURL=call.js.map
|