@webex/calling 3.7.0-next.8 → 3.7.0-wxcc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallHistory/CallHistory.js +67 -195
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +108 -331
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js +1 -25
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js +1 -4
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +2 -2
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +2 -2
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +5 -14
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +6 -6
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +348 -434
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +386 -516
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +6 -6
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +3 -3
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +1 -6
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +3 -2
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +7 -14
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +22 -84
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/register.js +59 -79
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +1 -1
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +14 -14
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Events/types.js +0 -2
- package/dist/Events/types.js.map +1 -1
- package/dist/common/Utils.js +13 -18
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +0 -97
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +3 -4
- package/dist/common/constants.js.map +1 -1
- package/dist/common/types.js +0 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +2 -64
- package/dist/module/CallHistory/callHistoryFixtures.js +0 -24
- package/dist/module/CallHistory/constants.js +0 -3
- package/dist/module/CallingClient/CallingClient.js +1 -1
- package/dist/module/CallingClient/calling/CallerId/index.js +6 -6
- package/dist/module/CallingClient/calling/call.js +22 -66
- package/dist/module/CallingClient/calling/callManager.js +5 -5
- package/dist/module/CallingClient/calling/types.js +0 -5
- package/dist/module/CallingClient/constants.js +2 -1
- package/dist/module/CallingClient/line/index.js +8 -14
- package/dist/module/CallingClient/registration/register.js +4 -12
- package/dist/module/Contacts/ContactsClient.js +2 -2
- package/dist/module/Events/types.js +0 -2
- package/dist/module/common/Utils.js +5 -12
- package/dist/module/common/constants.js +2 -3
- package/dist/module/common/types.js +0 -1
- package/dist/module/index.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts +2 -4
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts +2 -6
- package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
- package/dist/types/CallHistory/constants.d.ts +0 -3
- package/dist/types/CallHistory/constants.d.ts.map +1 -1
- package/dist/types/CallHistory/types.d.ts +0 -9
- package/dist/types/CallHistory/types.d.ts.map +1 -1
- 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 +5 -7
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +2 -6
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -1
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +2 -3
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/line/types.d.ts +1 -1
- package/dist/types/CallingClient/line/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +2 -4
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +0 -1
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +2 -15
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/common/Utils.d.ts +2 -2
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +0 -1
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +1 -2
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
|
|
4
|
-
var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
8
|
-
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
9
4
|
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
10
5
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
11
6
|
_Object$defineProperty(exports, "__esModule", {
|
|
@@ -27,7 +22,6 @@ var _internalMediaCore = require("@webex/internal-media-core");
|
|
|
27
22
|
var _xstate = require("xstate");
|
|
28
23
|
var _uuid = require("uuid");
|
|
29
24
|
var _webMediaEffects = require("@webex/web-media-effects");
|
|
30
|
-
var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
|
|
31
25
|
var _types = require("../../Errors/types");
|
|
32
26
|
var _Utils = require("../../common/Utils");
|
|
33
27
|
var _types2 = require("../../common/types");
|
|
@@ -42,8 +36,6 @@ var _CallerId = require("./CallerId");
|
|
|
42
36
|
var _types5 = require("../../Metrics/types");
|
|
43
37
|
var _Metrics = require("../../Metrics");
|
|
44
38
|
var _constants2 = require("../../common/constants");
|
|
45
|
-
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; }
|
|
46
|
-
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; }
|
|
47
39
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
48
40
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable tsdoc/syntax */ /* eslint-disable no-param-reassign */
|
|
49
41
|
/**
|
|
@@ -55,7 +47,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
55
47
|
/**
|
|
56
48
|
* @ignore
|
|
57
49
|
*/
|
|
58
|
-
function Call(activeUrl, webex, direction, deviceId, lineId, deleteCb, indicator
|
|
50
|
+
function Call(activeUrl, webex, destination, direction, deviceId, lineId, deleteCb, indicator) {
|
|
59
51
|
var _this;
|
|
60
52
|
(0, _classCallCheck2.default)(this, Call);
|
|
61
53
|
_this = _super.call(this);
|
|
@@ -97,49 +89,6 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
97
89
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaNegotiationCompleted", void 0);
|
|
98
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "receivedRoapOKSeq", void 0);
|
|
99
91
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "localAudioStream", void 0);
|
|
100
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "rtcMetrics", void 0);
|
|
101
|
-
/**
|
|
102
|
-
* Media failed, so collect a stats report from webrtc
|
|
103
|
-
* send a webrtc telemetry dump to the configured server using the internal media core check metrics configured callback
|
|
104
|
-
* @param {String} callFrom - the function calling this function, optional.
|
|
105
|
-
* @returns {Promise<void>}
|
|
106
|
-
*/
|
|
107
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "forceSendStatsReport", /*#__PURE__*/function () {
|
|
108
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
109
|
-
var callFrom, loggerContext, errorInfo, errorStatus, errorLog;
|
|
110
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
111
|
-
while (1) switch (_context.prev = _context.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
callFrom = _ref.callFrom;
|
|
114
|
-
loggerContext = {
|
|
115
|
-
file: _constants.CALL_FILE,
|
|
116
|
-
method: _this.forceSendStatsReport.name
|
|
117
|
-
};
|
|
118
|
-
_context.prev = 2;
|
|
119
|
-
_context.next = 5;
|
|
120
|
-
return _this.mediaConnection.forceRtcMetricsSend();
|
|
121
|
-
case 5:
|
|
122
|
-
_Logger.default.info("Successfully uploaded available webrtc telemetry statistics", loggerContext);
|
|
123
|
-
_Logger.default.info("callFrom: ".concat(callFrom), loggerContext);
|
|
124
|
-
_context.next = 15;
|
|
125
|
-
break;
|
|
126
|
-
case 9:
|
|
127
|
-
_context.prev = 9;
|
|
128
|
-
_context.t0 = _context["catch"](2);
|
|
129
|
-
errorInfo = _context.t0;
|
|
130
|
-
errorStatus = (0, _Utils.serviceErrorCodeHandler)(errorInfo, loggerContext);
|
|
131
|
-
errorLog = new Error("Failed to upload webrtc telemetry statistics. ".concat(errorStatus));
|
|
132
|
-
_Logger.default.error(errorLog, loggerContext);
|
|
133
|
-
case 15:
|
|
134
|
-
case "end":
|
|
135
|
-
return _context.stop();
|
|
136
|
-
}
|
|
137
|
-
}, _callee, null, [[2, 9]]);
|
|
138
|
-
}));
|
|
139
|
-
return function (_x) {
|
|
140
|
-
return _ref2.apply(this, arguments);
|
|
141
|
-
};
|
|
142
|
-
}());
|
|
143
92
|
/**
|
|
144
93
|
*
|
|
145
94
|
*/
|
|
@@ -163,7 +112,6 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
163
112
|
*/
|
|
164
113
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setCallId", function (callId) {
|
|
165
114
|
_this.callId = callId;
|
|
166
|
-
_this.rtcMetrics.updateCallId(callId);
|
|
167
115
|
_Logger.default.info("Setting callId : ".concat(_this.callId, " for correlationId: ").concat(_this.correlationId), {
|
|
168
116
|
file: _constants.CALL_FILE,
|
|
169
117
|
method: _this.setCallId.name
|
|
@@ -183,41 +131,38 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
183
131
|
* @param roapMessage
|
|
184
132
|
*/
|
|
185
133
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "post", /*#__PURE__*/function () {
|
|
186
|
-
var
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
134
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(roapMessage) {
|
|
135
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
136
|
+
while (1) switch (_context.prev = _context.next) {
|
|
190
137
|
case 0:
|
|
191
|
-
|
|
192
|
-
device: {
|
|
193
|
-
deviceId: _this.deviceId,
|
|
194
|
-
correlationId: _this.correlationId
|
|
195
|
-
},
|
|
196
|
-
localMedia: {
|
|
197
|
-
roap: roapMessage,
|
|
198
|
-
mediaId: (0, _uuid.v4)()
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
return _context2.abrupt("return", _this.webex.request({
|
|
138
|
+
return _context.abrupt("return", _this.webex.request({
|
|
202
139
|
uri: "".concat(_this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(_this.deviceId, "/").concat(_constants.CALL_ENDPOINT_RESOURCE),
|
|
203
140
|
method: _types2.HTTP_METHODS.POST,
|
|
204
141
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
205
142
|
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, _this.webex.internal.device.url), _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT),
|
|
206
|
-
body:
|
|
143
|
+
body: {
|
|
144
|
+
device: {
|
|
145
|
+
deviceId: _this.deviceId,
|
|
146
|
+
correlationId: _this.correlationId
|
|
147
|
+
},
|
|
207
148
|
callee: {
|
|
208
149
|
type: _this.destination.type,
|
|
209
150
|
address: _this.destination.address
|
|
151
|
+
},
|
|
152
|
+
localMedia: {
|
|
153
|
+
roap: roapMessage,
|
|
154
|
+
mediaId: (0, _uuid.v4)()
|
|
210
155
|
}
|
|
211
|
-
}
|
|
156
|
+
}
|
|
212
157
|
}));
|
|
213
|
-
case
|
|
158
|
+
case 1:
|
|
214
159
|
case "end":
|
|
215
|
-
return
|
|
160
|
+
return _context.stop();
|
|
216
161
|
}
|
|
217
|
-
},
|
|
162
|
+
}, _callee);
|
|
218
163
|
}));
|
|
219
|
-
return function (
|
|
220
|
-
return
|
|
164
|
+
return function (_x) {
|
|
165
|
+
return _ref.apply(this, arguments);
|
|
221
166
|
};
|
|
222
167
|
}());
|
|
223
168
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEffectEnabled", function () {
|
|
@@ -271,36 +216,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
271
216
|
/**
|
|
272
217
|
* Mutes/Unmutes the call.
|
|
273
218
|
*
|
|
274
|
-
* @param
|
|
275
|
-
* @param muteType - Identifies if mute was triggered by system or user.
|
|
276
|
-
*
|
|
277
|
-
* @example
|
|
278
|
-
* ```javascript
|
|
279
|
-
* call.mute(localAudioStream, 'system_mute')
|
|
280
|
-
* ```
|
|
219
|
+
* @param localAudioTrack -.
|
|
281
220
|
*/
|
|
282
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mute", function (localAudioStream
|
|
283
|
-
if (
|
|
284
|
-
_Logger.default.warn("Did not find a local stream while muting the call ".concat(_this.getCorrelationId(), "."), {
|
|
285
|
-
file: _constants.CALL_FILE,
|
|
286
|
-
method: 'mute'
|
|
287
|
-
});
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
if (muteType === _types4.MUTE_TYPE.SYSTEM) {
|
|
291
|
-
if (!localAudioStream.userMuted) {
|
|
292
|
-
_this.muted = localAudioStream.systemMuted;
|
|
293
|
-
} else {
|
|
294
|
-
_Logger.default.info("Call is muted by the user already - ".concat(_this.getCorrelationId(), "."), {
|
|
295
|
-
file: _constants.CALL_FILE,
|
|
296
|
-
method: 'mute'
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
} else if (!localAudioStream.systemMuted) {
|
|
221
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mute", function (localAudioStream) {
|
|
222
|
+
if (localAudioStream) {
|
|
300
223
|
localAudioStream.setUserMuted(!_this.muted);
|
|
301
224
|
_this.muted = !_this.muted;
|
|
302
225
|
} else {
|
|
303
|
-
_Logger.default.
|
|
226
|
+
_Logger.default.warn("Did not find a local stream while muting the call ".concat(_this.getCorrelationId(), "."), {
|
|
304
227
|
file: _constants.CALL_FILE,
|
|
305
228
|
method: 'mute'
|
|
306
229
|
});
|
|
@@ -377,9 +300,6 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
377
300
|
code: _types4.DisconnectCode.NORMAL,
|
|
378
301
|
cause: _types4.DisconnectCause.NORMAL
|
|
379
302
|
};
|
|
380
|
-
_this.rtcMetrics = new _internalPluginMetrics.RtcMetrics(_this.webex, {
|
|
381
|
-
callId: _this.callId
|
|
382
|
-
}, _this.correlationId);
|
|
383
303
|
var callMachine = (0, _xstate.createMachine)({
|
|
384
304
|
schema: {
|
|
385
305
|
context: {},
|
|
@@ -1111,37 +1031,37 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1111
1031
|
}, {
|
|
1112
1032
|
key: "handleOutgoingCallSetup",
|
|
1113
1033
|
value: (function () {
|
|
1114
|
-
var _handleOutgoingCallSetup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1034
|
+
var _handleOutgoingCallSetup = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(event) {
|
|
1115
1035
|
var _this2 = this;
|
|
1116
1036
|
var message, response, errData;
|
|
1117
|
-
return _regenerator.default.wrap(function
|
|
1118
|
-
while (1) switch (
|
|
1037
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
1038
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1119
1039
|
case 0:
|
|
1120
1040
|
_Logger.default.info("handleOutgoingCallSetup: ".concat(this.getCorrelationId(), " "), {
|
|
1121
1041
|
file: _constants.CALL_FILE,
|
|
1122
1042
|
method: this.handleOutgoingCallSetup.name
|
|
1123
1043
|
});
|
|
1124
1044
|
message = event.data;
|
|
1125
|
-
|
|
1126
|
-
|
|
1045
|
+
_context2.prev = 2;
|
|
1046
|
+
_context2.next = 5;
|
|
1127
1047
|
return this.post(message);
|
|
1128
1048
|
case 5:
|
|
1129
|
-
response =
|
|
1049
|
+
response = _context2.sent;
|
|
1130
1050
|
_Logger.default.log("handleOutgoingCallSetup: Response code: ".concat(response.statusCode), {
|
|
1131
1051
|
file: _constants.CALL_FILE,
|
|
1132
1052
|
method: this.handleOutgoingCallSetup.name
|
|
1133
1053
|
});
|
|
1134
1054
|
this.setCallId(response.body.callId);
|
|
1135
|
-
|
|
1055
|
+
_context2.next = 15;
|
|
1136
1056
|
break;
|
|
1137
1057
|
case 10:
|
|
1138
|
-
|
|
1139
|
-
|
|
1058
|
+
_context2.prev = 10;
|
|
1059
|
+
_context2.t0 = _context2["catch"](2);
|
|
1140
1060
|
_Logger.default.warn('Failed to setup the call', {
|
|
1141
1061
|
file: _constants.CALL_FILE,
|
|
1142
1062
|
method: this.handleOutgoingCallSetup.name
|
|
1143
1063
|
});
|
|
1144
|
-
errData =
|
|
1064
|
+
errData = _context2.t0;
|
|
1145
1065
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1146
1066
|
_this2.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
1147
1067
|
_this2.submitCallErrorMetric(error);
|
|
@@ -1157,11 +1077,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1157
1077
|
}, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, _constants.CALL_FILE);
|
|
1158
1078
|
case 15:
|
|
1159
1079
|
case "end":
|
|
1160
|
-
return
|
|
1080
|
+
return _context2.stop();
|
|
1161
1081
|
}
|
|
1162
|
-
},
|
|
1082
|
+
}, _callee2, this, [[2, 10]]);
|
|
1163
1083
|
}));
|
|
1164
|
-
function handleOutgoingCallSetup(
|
|
1084
|
+
function handleOutgoingCallSetup(_x2) {
|
|
1165
1085
|
return _handleOutgoingCallSetup.apply(this, arguments);
|
|
1166
1086
|
}
|
|
1167
1087
|
return handleOutgoingCallSetup;
|
|
@@ -1176,21 +1096,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1176
1096
|
}, {
|
|
1177
1097
|
key: "handleCallHold",
|
|
1178
1098
|
value: (function () {
|
|
1179
|
-
var _handleCallHold = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1099
|
+
var _handleCallHold = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(event) {
|
|
1180
1100
|
var _this3 = this;
|
|
1181
1101
|
var response, errData;
|
|
1182
|
-
return _regenerator.default.wrap(function
|
|
1183
|
-
while (1) switch (
|
|
1102
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
1103
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1184
1104
|
case 0:
|
|
1185
1105
|
_Logger.default.info("handleCallHold: ".concat(this.getCorrelationId(), " "), {
|
|
1186
1106
|
file: _constants.CALL_FILE,
|
|
1187
1107
|
method: this.handleCallHold.name
|
|
1188
1108
|
});
|
|
1189
|
-
|
|
1190
|
-
|
|
1109
|
+
_context4.prev = 1;
|
|
1110
|
+
_context4.next = 4;
|
|
1191
1111
|
return this.postSSRequest(undefined, _types3.SUPPLEMENTARY_SERVICES.HOLD);
|
|
1192
1112
|
case 4:
|
|
1193
|
-
response =
|
|
1113
|
+
response = _context4.sent;
|
|
1194
1114
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1195
1115
|
file: _constants.CALL_FILE,
|
|
1196
1116
|
method: this.handleCallHold.name
|
|
@@ -1201,10 +1121,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1201
1121
|
* received from Mobius and forwarded towards calling client
|
|
1202
1122
|
*/
|
|
1203
1123
|
if (this.isHeld() === false) {
|
|
1204
|
-
this.supplementaryServicesTimer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1124
|
+
this.supplementaryServicesTimer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
1205
1125
|
var errorContext, callError;
|
|
1206
|
-
return _regenerator.default.wrap(function
|
|
1207
|
-
while (1) switch (
|
|
1126
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
1127
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1208
1128
|
case 0:
|
|
1209
1129
|
errorContext = {
|
|
1210
1130
|
file: _constants.CALL_FILE,
|
|
@@ -1219,21 +1139,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1219
1139
|
_this3.submitCallErrorMetric(callError);
|
|
1220
1140
|
case 5:
|
|
1221
1141
|
case "end":
|
|
1222
|
-
return
|
|
1142
|
+
return _context3.stop();
|
|
1223
1143
|
}
|
|
1224
|
-
},
|
|
1144
|
+
}, _callee3);
|
|
1225
1145
|
})), _constants.SUPPLEMENTARY_SERVICES_TIMEOUT);
|
|
1226
1146
|
}
|
|
1227
|
-
|
|
1147
|
+
_context4.next = 14;
|
|
1228
1148
|
break;
|
|
1229
1149
|
case 9:
|
|
1230
|
-
|
|
1231
|
-
|
|
1150
|
+
_context4.prev = 9;
|
|
1151
|
+
_context4.t0 = _context4["catch"](1);
|
|
1232
1152
|
_Logger.default.warn('Failed to put the call on hold', {
|
|
1233
1153
|
file: _constants.CALL_FILE,
|
|
1234
1154
|
method: this.handleCallHold.name
|
|
1235
1155
|
});
|
|
1236
|
-
errData =
|
|
1156
|
+
errData = _context4.t0;
|
|
1237
1157
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1238
1158
|
_this3.emit(_types3.CALL_EVENT_KEYS.HOLD_ERROR, error);
|
|
1239
1159
|
_this3.submitCallErrorMetric(error);
|
|
@@ -1249,11 +1169,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1249
1169
|
}, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, _constants.CALL_FILE);
|
|
1250
1170
|
case 14:
|
|
1251
1171
|
case "end":
|
|
1252
|
-
return
|
|
1172
|
+
return _context4.stop();
|
|
1253
1173
|
}
|
|
1254
|
-
},
|
|
1174
|
+
}, _callee4, this, [[1, 9]]);
|
|
1255
1175
|
}));
|
|
1256
|
-
function handleCallHold(
|
|
1176
|
+
function handleCallHold(_x3) {
|
|
1257
1177
|
return _handleCallHold.apply(this, arguments);
|
|
1258
1178
|
}
|
|
1259
1179
|
return handleCallHold;
|
|
@@ -1268,21 +1188,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1268
1188
|
}, {
|
|
1269
1189
|
key: "handleCallResume",
|
|
1270
1190
|
value: (function () {
|
|
1271
|
-
var _handleCallResume = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1191
|
+
var _handleCallResume = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(event) {
|
|
1272
1192
|
var _this4 = this;
|
|
1273
1193
|
var response, errData;
|
|
1274
|
-
return _regenerator.default.wrap(function
|
|
1275
|
-
while (1) switch (
|
|
1194
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1195
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1276
1196
|
case 0:
|
|
1277
1197
|
_Logger.default.info("handleCallResume: ".concat(this.getCorrelationId(), " "), {
|
|
1278
1198
|
file: _constants.CALL_FILE,
|
|
1279
1199
|
method: this.handleCallResume.name
|
|
1280
1200
|
});
|
|
1281
|
-
|
|
1282
|
-
|
|
1201
|
+
_context6.prev = 1;
|
|
1202
|
+
_context6.next = 4;
|
|
1283
1203
|
return this.postSSRequest(undefined, _types3.SUPPLEMENTARY_SERVICES.RESUME);
|
|
1284
1204
|
case 4:
|
|
1285
|
-
response =
|
|
1205
|
+
response = _context6.sent;
|
|
1286
1206
|
_Logger.default.log("Response code: ".concat(response.statusCode), {
|
|
1287
1207
|
file: _constants.CALL_FILE,
|
|
1288
1208
|
method: this.handleCallResume.name
|
|
@@ -1293,10 +1213,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1293
1213
|
* received from Mobius on resuming the call and forwarded towards calling client
|
|
1294
1214
|
*/
|
|
1295
1215
|
if (this.isHeld() === true) {
|
|
1296
|
-
this.supplementaryServicesTimer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1216
|
+
this.supplementaryServicesTimer = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
1297
1217
|
var errorContext, callError;
|
|
1298
|
-
return _regenerator.default.wrap(function
|
|
1299
|
-
while (1) switch (
|
|
1218
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
1219
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1300
1220
|
case 0:
|
|
1301
1221
|
errorContext = {
|
|
1302
1222
|
file: _constants.CALL_FILE,
|
|
@@ -1311,21 +1231,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1311
1231
|
_this4.submitCallErrorMetric(callError);
|
|
1312
1232
|
case 5:
|
|
1313
1233
|
case "end":
|
|
1314
|
-
return
|
|
1234
|
+
return _context5.stop();
|
|
1315
1235
|
}
|
|
1316
|
-
},
|
|
1236
|
+
}, _callee5);
|
|
1317
1237
|
})), _constants.SUPPLEMENTARY_SERVICES_TIMEOUT);
|
|
1318
1238
|
}
|
|
1319
|
-
|
|
1239
|
+
_context6.next = 14;
|
|
1320
1240
|
break;
|
|
1321
1241
|
case 9:
|
|
1322
|
-
|
|
1323
|
-
|
|
1242
|
+
_context6.prev = 9;
|
|
1243
|
+
_context6.t0 = _context6["catch"](1);
|
|
1324
1244
|
_Logger.default.warn('Failed to resume the call', {
|
|
1325
1245
|
file: _constants.CALL_FILE,
|
|
1326
1246
|
method: this.handleCallResume.name
|
|
1327
1247
|
});
|
|
1328
|
-
errData =
|
|
1248
|
+
errData = _context6.t0;
|
|
1329
1249
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1330
1250
|
_this4.emit(_types3.CALL_EVENT_KEYS.RESUME_ERROR, error);
|
|
1331
1251
|
_this4.submitCallErrorMetric(error);
|
|
@@ -1341,11 +1261,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1341
1261
|
}, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, _constants.CALL_FILE);
|
|
1342
1262
|
case 14:
|
|
1343
1263
|
case "end":
|
|
1344
|
-
return
|
|
1264
|
+
return _context6.stop();
|
|
1345
1265
|
}
|
|
1346
|
-
},
|
|
1266
|
+
}, _callee6, this, [[1, 9]]);
|
|
1347
1267
|
}));
|
|
1348
|
-
function handleCallResume(
|
|
1268
|
+
function handleCallResume(_x4) {
|
|
1349
1269
|
return _handleCallResume.apply(this, arguments);
|
|
1350
1270
|
}
|
|
1351
1271
|
return handleCallResume;
|
|
@@ -1434,35 +1354,35 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1434
1354
|
}, {
|
|
1435
1355
|
key: "handleOutgoingCallAlerting",
|
|
1436
1356
|
value: (function () {
|
|
1437
|
-
var _handleOutgoingCallAlerting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1357
|
+
var _handleOutgoingCallAlerting = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(event) {
|
|
1438
1358
|
var _this5 = this;
|
|
1439
1359
|
var res, errData;
|
|
1440
|
-
return _regenerator.default.wrap(function
|
|
1441
|
-
while (1) switch (
|
|
1360
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
1361
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1442
1362
|
case 0:
|
|
1443
1363
|
_Logger.default.info("handleOutgoingCallAlerting: ".concat(this.getCorrelationId(), " "), {
|
|
1444
1364
|
file: _constants.CALL_FILE,
|
|
1445
1365
|
method: this.handleOutgoingCallAlerting.name
|
|
1446
1366
|
});
|
|
1447
|
-
|
|
1448
|
-
|
|
1367
|
+
_context7.prev = 1;
|
|
1368
|
+
_context7.next = 4;
|
|
1449
1369
|
return this.patch(_types4.MobiusCallState.ALERTING);
|
|
1450
1370
|
case 4:
|
|
1451
|
-
res =
|
|
1371
|
+
res = _context7.sent;
|
|
1452
1372
|
_Logger.default.log("PATCH response: ".concat(res.statusCode), {
|
|
1453
1373
|
file: _constants.CALL_FILE,
|
|
1454
1374
|
method: this.handleOutgoingCallAlerting.name
|
|
1455
1375
|
});
|
|
1456
|
-
|
|
1376
|
+
_context7.next = 13;
|
|
1457
1377
|
break;
|
|
1458
1378
|
case 8:
|
|
1459
|
-
|
|
1460
|
-
|
|
1379
|
+
_context7.prev = 8;
|
|
1380
|
+
_context7.t0 = _context7["catch"](1);
|
|
1461
1381
|
_Logger.default.warn('Failed to signal call progression', {
|
|
1462
1382
|
file: _constants.CALL_FILE,
|
|
1463
1383
|
method: this.handleOutgoingCallAlerting.name
|
|
1464
1384
|
});
|
|
1465
|
-
errData =
|
|
1385
|
+
errData = _context7.t0;
|
|
1466
1386
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1467
1387
|
_this5.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
1468
1388
|
_this5.submitCallErrorMetric(error);
|
|
@@ -1478,11 +1398,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1478
1398
|
}, this.getCorrelationId(), errData, this.handleOutgoingCallAlerting.name, _constants.CALL_FILE);
|
|
1479
1399
|
case 13:
|
|
1480
1400
|
case "end":
|
|
1481
|
-
return
|
|
1401
|
+
return _context7.stop();
|
|
1482
1402
|
}
|
|
1483
|
-
},
|
|
1403
|
+
}, _callee7, this, [[1, 8]]);
|
|
1484
1404
|
}));
|
|
1485
|
-
function handleOutgoingCallAlerting(
|
|
1405
|
+
function handleOutgoingCallAlerting(_x5) {
|
|
1486
1406
|
return _handleOutgoingCallAlerting.apply(this, arguments);
|
|
1487
1407
|
}
|
|
1488
1408
|
return handleOutgoingCallAlerting;
|
|
@@ -1523,11 +1443,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1523
1443
|
}, {
|
|
1524
1444
|
key: "handleOutgoingCallConnect",
|
|
1525
1445
|
value: (function () {
|
|
1526
|
-
var _handleOutgoingCallConnect = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1446
|
+
var _handleOutgoingCallConnect = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(event) {
|
|
1527
1447
|
var _this6 = this;
|
|
1528
1448
|
var res, errData;
|
|
1529
|
-
return _regenerator.default.wrap(function
|
|
1530
|
-
while (1) switch (
|
|
1449
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
1450
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1531
1451
|
case 0:
|
|
1532
1452
|
_Logger.default.info("handleOutgoingCallConnect: ".concat(this.getCorrelationId(), " "), {
|
|
1533
1453
|
file: _constants.CALL_FILE,
|
|
@@ -1536,38 +1456,38 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1536
1456
|
|
|
1537
1457
|
/* We should have received an Offer by now */
|
|
1538
1458
|
if (this.remoteRoapMessage) {
|
|
1539
|
-
|
|
1459
|
+
_context8.next = 4;
|
|
1540
1460
|
break;
|
|
1541
1461
|
}
|
|
1542
1462
|
_Logger.default.warn('Offer not yet received from remote end... Exiting', {
|
|
1543
1463
|
file: _constants.CALL_FILE,
|
|
1544
1464
|
method: this.handleOutgoingCallConnect.name
|
|
1545
1465
|
});
|
|
1546
|
-
return
|
|
1466
|
+
return _context8.abrupt("return");
|
|
1547
1467
|
case 4:
|
|
1548
|
-
|
|
1468
|
+
_context8.prev = 4;
|
|
1549
1469
|
/* Start Offer/Answer as we might have buffered the offer by now */
|
|
1550
1470
|
this.mediaConnection.roapMessageReceived(this.remoteRoapMessage);
|
|
1551
1471
|
|
|
1552
1472
|
/* send call_connect PATCH */
|
|
1553
|
-
|
|
1473
|
+
_context8.next = 8;
|
|
1554
1474
|
return this.patch(_types4.MobiusCallState.CONNECTED);
|
|
1555
1475
|
case 8:
|
|
1556
|
-
res =
|
|
1476
|
+
res = _context8.sent;
|
|
1557
1477
|
_Logger.default.log("PATCH response: ".concat(res.statusCode), {
|
|
1558
1478
|
file: _constants.CALL_FILE,
|
|
1559
1479
|
method: this.handleOutgoingCallConnect.name
|
|
1560
1480
|
});
|
|
1561
|
-
|
|
1481
|
+
_context8.next = 17;
|
|
1562
1482
|
break;
|
|
1563
1483
|
case 12:
|
|
1564
|
-
|
|
1565
|
-
|
|
1484
|
+
_context8.prev = 12;
|
|
1485
|
+
_context8.t0 = _context8["catch"](4);
|
|
1566
1486
|
_Logger.default.warn('Failed to connect the call', {
|
|
1567
1487
|
file: _constants.CALL_FILE,
|
|
1568
1488
|
method: this.handleOutgoingCallConnect.name
|
|
1569
1489
|
});
|
|
1570
|
-
errData =
|
|
1490
|
+
errData = _context8.t0;
|
|
1571
1491
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
1572
1492
|
_this6.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
1573
1493
|
_this6.submitCallErrorMetric(error);
|
|
@@ -1583,11 +1503,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1583
1503
|
}, this.getCorrelationId(), errData, this.handleOutgoingCallConnect.name, _constants.CALL_FILE);
|
|
1584
1504
|
case 17:
|
|
1585
1505
|
case "end":
|
|
1586
|
-
return
|
|
1506
|
+
return _context8.stop();
|
|
1587
1507
|
}
|
|
1588
|
-
},
|
|
1508
|
+
}, _callee8, this, [[4, 12]]);
|
|
1589
1509
|
}));
|
|
1590
|
-
function handleOutgoingCallConnect(
|
|
1510
|
+
function handleOutgoingCallConnect(_x6) {
|
|
1591
1511
|
return _handleOutgoingCallConnect.apply(this, arguments);
|
|
1592
1512
|
}
|
|
1593
1513
|
return handleOutgoingCallConnect;
|
|
@@ -1602,30 +1522,30 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1602
1522
|
}, {
|
|
1603
1523
|
key: "handleIncomingCallDisconnect",
|
|
1604
1524
|
value: (function () {
|
|
1605
|
-
var _handleIncomingCallDisconnect = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1525
|
+
var _handleIncomingCallDisconnect = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(event) {
|
|
1606
1526
|
var response;
|
|
1607
|
-
return _regenerator.default.wrap(function
|
|
1608
|
-
while (1) switch (
|
|
1527
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1528
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1609
1529
|
case 0:
|
|
1610
1530
|
_Logger.default.info("handleIncomingCallDisconnect: ".concat(this.getCorrelationId(), " "), {
|
|
1611
1531
|
file: _constants.CALL_FILE,
|
|
1612
1532
|
method: this.handleIncomingCallDisconnect.name
|
|
1613
1533
|
});
|
|
1614
1534
|
this.setDisconnectReason();
|
|
1615
|
-
|
|
1616
|
-
|
|
1535
|
+
_context9.prev = 2;
|
|
1536
|
+
_context9.next = 5;
|
|
1617
1537
|
return this.delete();
|
|
1618
1538
|
case 5:
|
|
1619
|
-
response =
|
|
1539
|
+
response = _context9.sent;
|
|
1620
1540
|
_Logger.default.log("handleOutgoingCallDisconnect: Response code: ".concat(response.statusCode), {
|
|
1621
1541
|
file: _constants.CALL_FILE,
|
|
1622
1542
|
method: this.handleIncomingCallDisconnect.name
|
|
1623
1543
|
});
|
|
1624
|
-
|
|
1544
|
+
_context9.next = 12;
|
|
1625
1545
|
break;
|
|
1626
1546
|
case 9:
|
|
1627
|
-
|
|
1628
|
-
|
|
1547
|
+
_context9.prev = 9;
|
|
1548
|
+
_context9.t0 = _context9["catch"](2);
|
|
1629
1549
|
_Logger.default.warn('Failed to delete the call', {
|
|
1630
1550
|
file: _constants.CALL_FILE,
|
|
1631
1551
|
method: this.handleIncomingCallDisconnect.name
|
|
@@ -1658,11 +1578,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1658
1578
|
this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.correlationId);
|
|
1659
1579
|
case 19:
|
|
1660
1580
|
case "end":
|
|
1661
|
-
return
|
|
1581
|
+
return _context9.stop();
|
|
1662
1582
|
}
|
|
1663
|
-
},
|
|
1583
|
+
}, _callee9, this, [[2, 9]]);
|
|
1664
1584
|
}));
|
|
1665
|
-
function handleIncomingCallDisconnect(
|
|
1585
|
+
function handleIncomingCallDisconnect(_x7) {
|
|
1666
1586
|
return _handleIncomingCallDisconnect.apply(this, arguments);
|
|
1667
1587
|
}
|
|
1668
1588
|
return handleIncomingCallDisconnect;
|
|
@@ -1677,26 +1597,26 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1677
1597
|
}, {
|
|
1678
1598
|
key: "handleOutgoingCallDisconnect",
|
|
1679
1599
|
value: (function () {
|
|
1680
|
-
var _handleOutgoingCallDisconnect = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1600
|
+
var _handleOutgoingCallDisconnect = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(event) {
|
|
1681
1601
|
var response;
|
|
1682
|
-
return _regenerator.default.wrap(function
|
|
1683
|
-
while (1) switch (
|
|
1602
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1603
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1684
1604
|
case 0:
|
|
1685
1605
|
this.setDisconnectReason();
|
|
1686
|
-
|
|
1687
|
-
|
|
1606
|
+
_context10.prev = 1;
|
|
1607
|
+
_context10.next = 4;
|
|
1688
1608
|
return this.delete();
|
|
1689
1609
|
case 4:
|
|
1690
|
-
response =
|
|
1610
|
+
response = _context10.sent;
|
|
1691
1611
|
_Logger.default.log("handleOutgoingCallDisconnect: Response code: ".concat(response.statusCode), {
|
|
1692
1612
|
file: _constants.CALL_FILE,
|
|
1693
1613
|
method: this.handleOutgoingCallDisconnect.name
|
|
1694
1614
|
});
|
|
1695
|
-
|
|
1615
|
+
_context10.next = 11;
|
|
1696
1616
|
break;
|
|
1697
1617
|
case 8:
|
|
1698
|
-
|
|
1699
|
-
|
|
1618
|
+
_context10.prev = 8;
|
|
1619
|
+
_context10.t0 = _context10["catch"](1);
|
|
1700
1620
|
_Logger.default.warn('Failed to delete the call', {
|
|
1701
1621
|
file: _constants.CALL_FILE,
|
|
1702
1622
|
method: this.handleOutgoingCallDisconnect.name
|
|
@@ -1728,11 +1648,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1728
1648
|
});
|
|
1729
1649
|
case 17:
|
|
1730
1650
|
case "end":
|
|
1731
|
-
return
|
|
1651
|
+
return _context10.stop();
|
|
1732
1652
|
}
|
|
1733
|
-
},
|
|
1653
|
+
}, _callee10, this, [[1, 8]]);
|
|
1734
1654
|
}));
|
|
1735
|
-
function handleOutgoingCallDisconnect(
|
|
1655
|
+
function handleOutgoingCallDisconnect(_x8) {
|
|
1736
1656
|
return _handleOutgoingCallDisconnect.apply(this, arguments);
|
|
1737
1657
|
}
|
|
1738
1658
|
return handleOutgoingCallDisconnect;
|
|
@@ -1766,26 +1686,26 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1766
1686
|
});
|
|
1767
1687
|
clearInterval(this.sessionTimer);
|
|
1768
1688
|
}
|
|
1769
|
-
this.sessionTimer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1689
|
+
this.sessionTimer = setInterval( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1770
1690
|
var res, error;
|
|
1771
|
-
return _regenerator.default.wrap(function
|
|
1772
|
-
while (1) switch (
|
|
1691
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1692
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1773
1693
|
case 0:
|
|
1774
|
-
|
|
1775
|
-
|
|
1694
|
+
_context11.prev = 0;
|
|
1695
|
+
_context11.next = 3;
|
|
1776
1696
|
return _this7.postStatus();
|
|
1777
1697
|
case 3:
|
|
1778
|
-
res =
|
|
1698
|
+
res = _context11.sent;
|
|
1779
1699
|
_Logger.default.info("Session refresh successful", {
|
|
1780
1700
|
file: _constants.CALL_FILE,
|
|
1781
1701
|
method: 'handleCallEstablished'
|
|
1782
1702
|
});
|
|
1783
|
-
|
|
1703
|
+
_context11.next = 12;
|
|
1784
1704
|
break;
|
|
1785
1705
|
case 7:
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
error =
|
|
1706
|
+
_context11.prev = 7;
|
|
1707
|
+
_context11.t0 = _context11["catch"](0);
|
|
1708
|
+
error = _context11.t0;
|
|
1789
1709
|
/* We are clearing the timer here as all are error scenarios. Only scenario where
|
|
1790
1710
|
* timer reset won't be required is 503 with retry after. But that case will
|
|
1791
1711
|
* be handled automatically as Mobius will also reset timer when we post status
|
|
@@ -1811,9 +1731,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1811
1731
|
}, _this7.getCorrelationId(), error, _this7.handleCallEstablished.name, _constants.CALL_FILE);
|
|
1812
1732
|
case 12:
|
|
1813
1733
|
case "end":
|
|
1814
|
-
return
|
|
1734
|
+
return _context11.stop();
|
|
1815
1735
|
}
|
|
1816
|
-
},
|
|
1736
|
+
}, _callee11, null, [[0, 7]]);
|
|
1817
1737
|
})), _constants.DEFAULT_SESSION_TIMER);
|
|
1818
1738
|
}
|
|
1819
1739
|
|
|
@@ -1825,10 +1745,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1825
1745
|
}, {
|
|
1826
1746
|
key: "handleUnknownState",
|
|
1827
1747
|
value: (function () {
|
|
1828
|
-
var _handleUnknownState = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1748
|
+
var _handleUnknownState = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(event) {
|
|
1829
1749
|
var eventData, response;
|
|
1830
|
-
return _regenerator.default.wrap(function
|
|
1831
|
-
while (1) switch (
|
|
1750
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1751
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1832
1752
|
case 0:
|
|
1833
1753
|
_Logger.default.info("handleUnknownState: ".concat(this.getCorrelationId(), " "), {
|
|
1834
1754
|
file: _constants.CALL_FILE,
|
|
@@ -1849,21 +1769,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1849
1769
|
/* We need to clear the call at Mobius too. For delete failure
|
|
1850
1770
|
* error handling is not required
|
|
1851
1771
|
*/
|
|
1852
|
-
|
|
1772
|
+
_context12.prev = 3;
|
|
1853
1773
|
this.setDisconnectReason();
|
|
1854
|
-
|
|
1774
|
+
_context12.next = 7;
|
|
1855
1775
|
return this.delete();
|
|
1856
1776
|
case 7:
|
|
1857
|
-
response =
|
|
1777
|
+
response = _context12.sent;
|
|
1858
1778
|
_Logger.default.log("handleOutgoingCallDisconnect: Response code: ".concat(response.statusCode), {
|
|
1859
1779
|
file: _constants.CALL_FILE,
|
|
1860
1780
|
method: this.handleUnknownState.name
|
|
1861
1781
|
});
|
|
1862
|
-
|
|
1782
|
+
_context12.next = 14;
|
|
1863
1783
|
break;
|
|
1864
1784
|
case 11:
|
|
1865
|
-
|
|
1866
|
-
|
|
1785
|
+
_context12.prev = 11;
|
|
1786
|
+
_context12.t0 = _context12["catch"](3);
|
|
1867
1787
|
_Logger.default.warn('Failed to delete the call', {
|
|
1868
1788
|
file: _constants.CALL_FILE,
|
|
1869
1789
|
method: this.handleUnknownState.name
|
|
@@ -1888,11 +1808,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1888
1808
|
});
|
|
1889
1809
|
case 19:
|
|
1890
1810
|
case "end":
|
|
1891
|
-
return
|
|
1811
|
+
return _context12.stop();
|
|
1892
1812
|
}
|
|
1893
|
-
},
|
|
1813
|
+
}, _callee12, this, [[3, 11]]);
|
|
1894
1814
|
}));
|
|
1895
|
-
function handleUnknownState(
|
|
1815
|
+
function handleUnknownState(_x9) {
|
|
1896
1816
|
return _handleUnknownState.apply(this, arguments);
|
|
1897
1817
|
}
|
|
1898
1818
|
return handleUnknownState;
|
|
@@ -1961,27 +1881,27 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1961
1881
|
}, {
|
|
1962
1882
|
key: "handleRoapEstablished",
|
|
1963
1883
|
value: (function () {
|
|
1964
|
-
var _handleRoapEstablished = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1884
|
+
var _handleRoapEstablished = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(context, event) {
|
|
1965
1885
|
var _this9 = this;
|
|
1966
|
-
var
|
|
1967
|
-
return _regenerator.default.wrap(function
|
|
1968
|
-
while (1) switch (
|
|
1886
|
+
var _ref5, received, message, res, errData;
|
|
1887
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1888
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1969
1889
|
case 0:
|
|
1970
1890
|
_Logger.default.info("handleRoapEstablished: ".concat(this.getCorrelationId(), " "), {
|
|
1971
1891
|
file: _constants.CALL_FILE,
|
|
1972
1892
|
method: 'handleRoapEstablished'
|
|
1973
1893
|
});
|
|
1974
|
-
|
|
1894
|
+
_ref5 = event.data, received = _ref5.received, message = _ref5.message;
|
|
1975
1895
|
this.receivedRoapOKSeq = message.seq;
|
|
1976
1896
|
if (received) {
|
|
1977
|
-
|
|
1897
|
+
_context13.next = 22;
|
|
1978
1898
|
break;
|
|
1979
1899
|
}
|
|
1980
1900
|
_Logger.default.info('Sending Media Ok to the remote End', {
|
|
1981
1901
|
file: _constants.CALL_FILE,
|
|
1982
1902
|
method: 'handleRoapEstablished'
|
|
1983
1903
|
});
|
|
1984
|
-
|
|
1904
|
+
_context13.prev = 5;
|
|
1985
1905
|
if (this.callStateMachine.state.value === 'S_RECV_CALL_PROGRESS' || this.callStateMachine.state.value === 'S_SEND_CALL_SETUP') {
|
|
1986
1906
|
_Logger.default.info('Media negotiation completed before call connect. Setting media negotiation completed flag.', {
|
|
1987
1907
|
file: _constants.CALL_FILE,
|
|
@@ -1990,10 +1910,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
1990
1910
|
this.mediaNegotiationCompleted = true;
|
|
1991
1911
|
}
|
|
1992
1912
|
message.seq = this.seq;
|
|
1993
|
-
|
|
1913
|
+
_context13.next = 10;
|
|
1994
1914
|
return this.postMedia(message);
|
|
1995
1915
|
case 10:
|
|
1996
|
-
res =
|
|
1916
|
+
res = _context13.sent;
|
|
1997
1917
|
_Logger.default.log("handleRoapEstablished: Response code: ".concat(res.statusCode), {
|
|
1998
1918
|
file: _constants.CALL_FILE,
|
|
1999
1919
|
method: 'handleRoapEstablished'
|
|
@@ -2004,16 +1924,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2004
1924
|
type: 'E_CALL_ESTABLISHED'
|
|
2005
1925
|
});
|
|
2006
1926
|
}
|
|
2007
|
-
|
|
1927
|
+
_context13.next = 20;
|
|
2008
1928
|
break;
|
|
2009
1929
|
case 15:
|
|
2010
|
-
|
|
2011
|
-
|
|
1930
|
+
_context13.prev = 15;
|
|
1931
|
+
_context13.t0 = _context13["catch"](5);
|
|
2012
1932
|
_Logger.default.warn('Failed to process MediaOk request', {
|
|
2013
1933
|
file: _constants.CALL_FILE,
|
|
2014
1934
|
method: 'handleRoapEstablished'
|
|
2015
1935
|
});
|
|
2016
|
-
errData =
|
|
1936
|
+
errData = _context13.t0;
|
|
2017
1937
|
(0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
|
|
2018
1938
|
/* Start retry if only it is a midcall case */
|
|
2019
1939
|
/* istanbul ignore else */
|
|
@@ -2027,7 +1947,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2027
1947
|
}
|
|
2028
1948
|
}, this.getCorrelationId(), errData, this.handleRoapEstablished.name, _constants.CALL_FILE);
|
|
2029
1949
|
case 20:
|
|
2030
|
-
|
|
1950
|
+
_context13.next = 27;
|
|
2031
1951
|
break;
|
|
2032
1952
|
case 22:
|
|
2033
1953
|
_Logger.default.info('Notifying internal-media-core about ROAP OK message', {
|
|
@@ -2061,11 +1981,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2061
1981
|
}
|
|
2062
1982
|
case 27:
|
|
2063
1983
|
case "end":
|
|
2064
|
-
return
|
|
1984
|
+
return _context13.stop();
|
|
2065
1985
|
}
|
|
2066
|
-
},
|
|
1986
|
+
}, _callee13, this, [[5, 15]]);
|
|
2067
1987
|
}));
|
|
2068
|
-
function handleRoapEstablished(
|
|
1988
|
+
function handleRoapEstablished(_x10, _x11) {
|
|
2069
1989
|
return _handleRoapEstablished.apply(this, arguments);
|
|
2070
1990
|
}
|
|
2071
1991
|
return handleRoapEstablished;
|
|
@@ -2080,11 +2000,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2080
2000
|
}, {
|
|
2081
2001
|
key: "handleRoapError",
|
|
2082
2002
|
value: (function () {
|
|
2083
|
-
var _handleRoapError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2003
|
+
var _handleRoapError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(context, event) {
|
|
2084
2004
|
var _this10 = this;
|
|
2085
2005
|
var message, res, errData;
|
|
2086
|
-
return _regenerator.default.wrap(function
|
|
2087
|
-
while (1) switch (
|
|
2006
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
2007
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
2088
2008
|
case 0:
|
|
2089
2009
|
_Logger.default.info("handleRoapError: ".concat(this.getCorrelationId()), {
|
|
2090
2010
|
file: _constants.CALL_FILE,
|
|
@@ -2095,28 +2015,28 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2095
2015
|
message = event.data;
|
|
2096
2016
|
/* istanbul ignore else */
|
|
2097
2017
|
if (!message) {
|
|
2098
|
-
|
|
2018
|
+
_context14.next = 15;
|
|
2099
2019
|
break;
|
|
2100
2020
|
}
|
|
2101
|
-
|
|
2102
|
-
|
|
2021
|
+
_context14.prev = 3;
|
|
2022
|
+
_context14.next = 6;
|
|
2103
2023
|
return this.postMedia(message);
|
|
2104
2024
|
case 6:
|
|
2105
|
-
res =
|
|
2025
|
+
res = _context14.sent;
|
|
2106
2026
|
_Logger.default.info("Response code: ".concat(res.statusCode), {
|
|
2107
2027
|
file: _constants.CALL_FILE,
|
|
2108
2028
|
method: this.handleRoapError.name
|
|
2109
2029
|
});
|
|
2110
|
-
|
|
2030
|
+
_context14.next = 15;
|
|
2111
2031
|
break;
|
|
2112
2032
|
case 10:
|
|
2113
|
-
|
|
2114
|
-
|
|
2033
|
+
_context14.prev = 10;
|
|
2034
|
+
_context14.t0 = _context14["catch"](3);
|
|
2115
2035
|
_Logger.default.warn('Failed to communicate ROAP error to Webex Calling', {
|
|
2116
2036
|
file: _constants.CALL_FILE,
|
|
2117
2037
|
method: this.handleRoapError.name
|
|
2118
2038
|
});
|
|
2119
|
-
errData =
|
|
2039
|
+
errData = _context14.t0;
|
|
2120
2040
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
2121
2041
|
_this10.emit(_types3.CALL_EVENT_KEYS.CALL_ERROR, error);
|
|
2122
2042
|
_this10.submitCallErrorMetric(error);
|
|
@@ -2143,11 +2063,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2143
2063
|
}
|
|
2144
2064
|
case 16:
|
|
2145
2065
|
case "end":
|
|
2146
|
-
return
|
|
2066
|
+
return _context14.stop();
|
|
2147
2067
|
}
|
|
2148
|
-
},
|
|
2068
|
+
}, _callee14, this, [[3, 10]]);
|
|
2149
2069
|
}));
|
|
2150
|
-
function handleRoapError(
|
|
2070
|
+
function handleRoapError(_x12, _x13) {
|
|
2151
2071
|
return _handleRoapError.apply(this, arguments);
|
|
2152
2072
|
}
|
|
2153
2073
|
return handleRoapError;
|
|
@@ -2162,11 +2082,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2162
2082
|
}, {
|
|
2163
2083
|
key: "handleOutgoingRoapOffer",
|
|
2164
2084
|
value: (function () {
|
|
2165
|
-
var _handleOutgoingRoapOffer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2085
|
+
var _handleOutgoingRoapOffer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(context, event) {
|
|
2166
2086
|
var _this11 = this;
|
|
2167
2087
|
var message, res, errData;
|
|
2168
|
-
return _regenerator.default.wrap(function
|
|
2169
|
-
while (1) switch (
|
|
2088
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
2089
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
2170
2090
|
case 0:
|
|
2171
2091
|
_Logger.default.info("handleOutgoingRoapOffer: ".concat(this.getCorrelationId()), {
|
|
2172
2092
|
file: _constants.CALL_FILE,
|
|
@@ -2174,7 +2094,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2174
2094
|
});
|
|
2175
2095
|
message = event.data;
|
|
2176
2096
|
if (message !== null && message !== void 0 && message.sdp) {
|
|
2177
|
-
|
|
2097
|
+
_context15.next = 6;
|
|
2178
2098
|
break;
|
|
2179
2099
|
}
|
|
2180
2100
|
_Logger.default.info('Initializing Offer...', {
|
|
@@ -2182,27 +2102,27 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2182
2102
|
method: this.handleOutgoingRoapOffer.name
|
|
2183
2103
|
});
|
|
2184
2104
|
this.mediaConnection.initiateOffer();
|
|
2185
|
-
return
|
|
2105
|
+
return _context15.abrupt("return");
|
|
2186
2106
|
case 6:
|
|
2187
|
-
|
|
2188
|
-
|
|
2107
|
+
_context15.prev = 6;
|
|
2108
|
+
_context15.next = 9;
|
|
2189
2109
|
return this.postMedia(message);
|
|
2190
2110
|
case 9:
|
|
2191
|
-
res =
|
|
2111
|
+
res = _context15.sent;
|
|
2192
2112
|
_Logger.default.log("handleOutgoingRoapOffer: Response code: ".concat(res.statusCode), {
|
|
2193
2113
|
file: _constants.CALL_FILE,
|
|
2194
2114
|
method: this.handleOutgoingRoapOffer.name
|
|
2195
2115
|
});
|
|
2196
|
-
|
|
2116
|
+
_context15.next = 18;
|
|
2197
2117
|
break;
|
|
2198
2118
|
case 13:
|
|
2199
|
-
|
|
2200
|
-
|
|
2119
|
+
_context15.prev = 13;
|
|
2120
|
+
_context15.t0 = _context15["catch"](6);
|
|
2201
2121
|
_Logger.default.warn('Failed to process MediaOk request', {
|
|
2202
2122
|
file: _constants.CALL_FILE,
|
|
2203
2123
|
method: this.handleOutgoingRoapOffer.name
|
|
2204
2124
|
});
|
|
2205
|
-
errData =
|
|
2125
|
+
errData = _context15.t0;
|
|
2206
2126
|
(0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
|
|
2207
2127
|
/* Start retry if only it is a midcall case */
|
|
2208
2128
|
if (_this11.connected) {
|
|
@@ -2216,11 +2136,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2216
2136
|
}, this.getCorrelationId(), errData, this.handleOutgoingRoapOffer.name, _constants.CALL_FILE);
|
|
2217
2137
|
case 18:
|
|
2218
2138
|
case "end":
|
|
2219
|
-
return
|
|
2139
|
+
return _context15.stop();
|
|
2220
2140
|
}
|
|
2221
|
-
},
|
|
2141
|
+
}, _callee15, this, [[6, 13]]);
|
|
2222
2142
|
}));
|
|
2223
|
-
function handleOutgoingRoapOffer(
|
|
2143
|
+
function handleOutgoingRoapOffer(_x14, _x15) {
|
|
2224
2144
|
return _handleOutgoingRoapOffer.apply(this, arguments);
|
|
2225
2145
|
}
|
|
2226
2146
|
return handleOutgoingRoapOffer;
|
|
@@ -2235,37 +2155,37 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2235
2155
|
}, {
|
|
2236
2156
|
key: "handleOutgoingRoapAnswer",
|
|
2237
2157
|
value: (function () {
|
|
2238
|
-
var _handleOutgoingRoapAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2158
|
+
var _handleOutgoingRoapAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(context, event) {
|
|
2239
2159
|
var _this12 = this;
|
|
2240
2160
|
var message, res, errData;
|
|
2241
|
-
return _regenerator.default.wrap(function
|
|
2242
|
-
while (1) switch (
|
|
2161
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
2162
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
2243
2163
|
case 0:
|
|
2244
2164
|
_Logger.default.info("handleOutgoingRoapAnswer: ".concat(this.getCorrelationId()), {
|
|
2245
2165
|
file: _constants.CALL_FILE,
|
|
2246
2166
|
method: this.handleOutgoingRoapAnswer.name
|
|
2247
2167
|
});
|
|
2248
2168
|
message = event.data;
|
|
2249
|
-
|
|
2169
|
+
_context16.prev = 2;
|
|
2250
2170
|
message.seq = this.seq;
|
|
2251
|
-
|
|
2171
|
+
_context16.next = 6;
|
|
2252
2172
|
return this.postMedia(message);
|
|
2253
2173
|
case 6:
|
|
2254
|
-
res =
|
|
2174
|
+
res = _context16.sent;
|
|
2255
2175
|
_Logger.default.log("handleOutgoingRoapAnswer: Response code: ".concat(res.statusCode), {
|
|
2256
2176
|
file: _constants.CALL_FILE,
|
|
2257
2177
|
method: this.handleOutgoingRoapAnswer.name
|
|
2258
2178
|
});
|
|
2259
|
-
|
|
2179
|
+
_context16.next = 15;
|
|
2260
2180
|
break;
|
|
2261
2181
|
case 10:
|
|
2262
|
-
|
|
2263
|
-
|
|
2182
|
+
_context16.prev = 10;
|
|
2183
|
+
_context16.t0 = _context16["catch"](2);
|
|
2264
2184
|
_Logger.default.warn('Failed to send MediaAnswer request', {
|
|
2265
2185
|
file: _constants.CALL_FILE,
|
|
2266
2186
|
method: this.handleOutgoingRoapAnswer.name
|
|
2267
2187
|
});
|
|
2268
|
-
errData =
|
|
2188
|
+
errData = _context16.t0;
|
|
2269
2189
|
(0, _Utils.handleCallErrors)(this.getEmitterCallback(errData), _types.ERROR_LAYER.MEDIA, function (interval) {
|
|
2270
2190
|
/* Start retry if only it is a midcall case */
|
|
2271
2191
|
if (_this12.connected) {
|
|
@@ -2279,11 +2199,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2279
2199
|
}, this.getCorrelationId(), errData, this.handleOutgoingRoapAnswer.name, _constants.CALL_FILE);
|
|
2280
2200
|
case 15:
|
|
2281
2201
|
case "end":
|
|
2282
|
-
return
|
|
2202
|
+
return _context16.stop();
|
|
2283
2203
|
}
|
|
2284
|
-
},
|
|
2204
|
+
}, _callee16, this, [[2, 10]]);
|
|
2285
2205
|
}));
|
|
2286
|
-
function handleOutgoingRoapAnswer(
|
|
2206
|
+
function handleOutgoingRoapAnswer(_x16, _x17) {
|
|
2287
2207
|
return _handleOutgoingRoapAnswer.apply(this, arguments);
|
|
2288
2208
|
}
|
|
2289
2209
|
return handleOutgoingRoapAnswer;
|
|
@@ -2354,9 +2274,8 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2354
2274
|
this.mediaConnection.roapMessageReceived(message);
|
|
2355
2275
|
}
|
|
2356
2276
|
}
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
value: /* istanbul ignore next */
|
|
2277
|
+
|
|
2278
|
+
/* istanbul ignore next */
|
|
2360
2279
|
/**
|
|
2361
2280
|
* Initialize Media Connection.
|
|
2362
2281
|
*
|
|
@@ -2364,8 +2283,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2364
2283
|
* @param settings.localAudioTrack - MediaStreamTrack.
|
|
2365
2284
|
* @param settings.debugId - String.
|
|
2366
2285
|
*/
|
|
2367
|
-
|
|
2368
|
-
|
|
2286
|
+
}, {
|
|
2287
|
+
key: "initMediaConnection",
|
|
2288
|
+
value: function initMediaConnection(localAudioTrack, debugId) {
|
|
2369
2289
|
var mediaConnection = new _internalMediaCore.RoapMediaConnection({
|
|
2370
2290
|
skipInactiveTransceivers: true,
|
|
2371
2291
|
iceServers: [],
|
|
@@ -2384,13 +2304,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2384
2304
|
video: 'inactive',
|
|
2385
2305
|
screenShareVideo: 'inactive'
|
|
2386
2306
|
}
|
|
2387
|
-
}, debugId || "WebexCallSDK-".concat(this.correlationId)
|
|
2388
|
-
return _this13.rtcMetrics.addMetrics(data);
|
|
2389
|
-
}, function () {
|
|
2390
|
-
return _this13.rtcMetrics.closeMetrics();
|
|
2391
|
-
}, function () {
|
|
2392
|
-
return _this13.rtcMetrics.sendMetricsInQueue();
|
|
2393
|
-
});
|
|
2307
|
+
}, debugId || "WebexCallSDK-".concat(this.correlationId));
|
|
2394
2308
|
this.mediaConnection = mediaConnection;
|
|
2395
2309
|
}
|
|
2396
2310
|
}, {
|
|
@@ -2443,15 +2357,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2443
2357
|
* @param localAudioStream - The local audio stream for the call.
|
|
2444
2358
|
*/
|
|
2445
2359
|
function () {
|
|
2446
|
-
var _answer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2360
|
+
var _answer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(localAudioStream) {
|
|
2447
2361
|
var localAudioTrack;
|
|
2448
|
-
return _regenerator.default.wrap(function
|
|
2449
|
-
while (1) switch (
|
|
2362
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
2363
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
2450
2364
|
case 0:
|
|
2451
2365
|
this.localAudioStream = localAudioStream;
|
|
2452
2366
|
localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
|
|
2453
2367
|
if (localAudioTrack) {
|
|
2454
|
-
|
|
2368
|
+
_context17.next = 7;
|
|
2455
2369
|
break;
|
|
2456
2370
|
}
|
|
2457
2371
|
_Logger.default.warn("Did not find a local track while answering the call ".concat(this.getCorrelationId()), {
|
|
@@ -2462,7 +2376,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2462
2376
|
this.sendCallStateMachineEvt({
|
|
2463
2377
|
type: 'E_SEND_CALL_DISCONNECT'
|
|
2464
2378
|
});
|
|
2465
|
-
return
|
|
2379
|
+
return _context17.abrupt("return");
|
|
2466
2380
|
case 7:
|
|
2467
2381
|
localAudioTrack.enabled = true;
|
|
2468
2382
|
if (!this.mediaConnection) {
|
|
@@ -2483,11 +2397,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2483
2397
|
}
|
|
2484
2398
|
case 10:
|
|
2485
2399
|
case "end":
|
|
2486
|
-
return
|
|
2400
|
+
return _context17.stop();
|
|
2487
2401
|
}
|
|
2488
|
-
},
|
|
2402
|
+
}, _callee17, this);
|
|
2489
2403
|
}));
|
|
2490
|
-
function answer(
|
|
2404
|
+
function answer(_x18) {
|
|
2491
2405
|
return _answer.apply(this, arguments);
|
|
2492
2406
|
}
|
|
2493
2407
|
return answer;
|
|
@@ -2500,15 +2414,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2500
2414
|
}, {
|
|
2501
2415
|
key: "dial",
|
|
2502
2416
|
value: (function () {
|
|
2503
|
-
var _dial = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2417
|
+
var _dial = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(localAudioStream) {
|
|
2504
2418
|
var localAudioTrack;
|
|
2505
|
-
return _regenerator.default.wrap(function
|
|
2506
|
-
while (1) switch (
|
|
2419
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
2420
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
2507
2421
|
case 0:
|
|
2508
2422
|
this.localAudioStream = localAudioStream;
|
|
2509
2423
|
localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
|
|
2510
2424
|
if (localAudioTrack) {
|
|
2511
|
-
|
|
2425
|
+
_context18.next = 7;
|
|
2512
2426
|
break;
|
|
2513
2427
|
}
|
|
2514
2428
|
_Logger.default.warn("Did not find a local track while dialing the call ".concat(this.getCorrelationId()), {
|
|
@@ -2517,7 +2431,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2517
2431
|
});
|
|
2518
2432
|
this.deleteCb(this.getCorrelationId());
|
|
2519
2433
|
this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());
|
|
2520
|
-
return
|
|
2434
|
+
return _context18.abrupt("return");
|
|
2521
2435
|
case 7:
|
|
2522
2436
|
localAudioTrack.enabled = true;
|
|
2523
2437
|
if (!this.mediaConnection) {
|
|
@@ -2538,11 +2452,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2538
2452
|
}
|
|
2539
2453
|
case 10:
|
|
2540
2454
|
case "end":
|
|
2541
|
-
return
|
|
2455
|
+
return _context18.stop();
|
|
2542
2456
|
}
|
|
2543
|
-
},
|
|
2457
|
+
}, _callee18, this);
|
|
2544
2458
|
}));
|
|
2545
|
-
function dial(
|
|
2459
|
+
function dial(_x19) {
|
|
2546
2460
|
return _dial.apply(this, arguments);
|
|
2547
2461
|
}
|
|
2548
2462
|
return dial;
|
|
@@ -2556,15 +2470,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2556
2470
|
* @param state -.
|
|
2557
2471
|
*/
|
|
2558
2472
|
function () {
|
|
2559
|
-
var _patch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2560
|
-
return _regenerator.default.wrap(function
|
|
2561
|
-
while (1) switch (
|
|
2473
|
+
var _patch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(state) {
|
|
2474
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
2475
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
2562
2476
|
case 0:
|
|
2563
2477
|
_Logger.default.info("Send a PATCH for ".concat(state, " to Webex Calling"), {
|
|
2564
2478
|
file: _constants.CALL_FILE,
|
|
2565
2479
|
method: this.patch.name
|
|
2566
2480
|
});
|
|
2567
|
-
return
|
|
2481
|
+
return _context19.abrupt("return", this.webex.request({
|
|
2568
2482
|
// Sample uri: http://localhost/api/v1/calling/web/devices/{deviceid}/calls/{callid}
|
|
2569
2483
|
|
|
2570
2484
|
uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId),
|
|
@@ -2583,11 +2497,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2583
2497
|
}));
|
|
2584
2498
|
case 2:
|
|
2585
2499
|
case "end":
|
|
2586
|
-
return
|
|
2500
|
+
return _context19.stop();
|
|
2587
2501
|
}
|
|
2588
|
-
},
|
|
2502
|
+
}, _callee19, this);
|
|
2589
2503
|
}));
|
|
2590
|
-
function patch(
|
|
2504
|
+
function patch(_x20) {
|
|
2591
2505
|
return _patch.apply(this, arguments);
|
|
2592
2506
|
}
|
|
2593
2507
|
return patch;
|
|
@@ -2602,10 +2516,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2602
2516
|
}, {
|
|
2603
2517
|
key: "postSSRequest",
|
|
2604
2518
|
value: (function () {
|
|
2605
|
-
var _postSSRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2519
|
+
var _postSSRequest = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(context, type) {
|
|
2606
2520
|
var request, transferContext;
|
|
2607
|
-
return _regenerator.default.wrap(function
|
|
2608
|
-
while (1) switch (
|
|
2521
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
2522
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
2609
2523
|
case 0:
|
|
2610
2524
|
request = {
|
|
2611
2525
|
uri: "".concat(this.mobiusUrl).concat(_constants2.SERVICES_ENDPOINT),
|
|
@@ -2620,15 +2534,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2620
2534
|
callId: this.callId
|
|
2621
2535
|
}
|
|
2622
2536
|
};
|
|
2623
|
-
|
|
2624
|
-
|
|
2537
|
+
_context20.t0 = type;
|
|
2538
|
+
_context20.next = _context20.t0 === _types3.SUPPLEMENTARY_SERVICES.HOLD ? 4 : _context20.t0 === _types3.SUPPLEMENTARY_SERVICES.RESUME ? 6 : _context20.t0 === _types3.SUPPLEMENTARY_SERVICES.TRANSFER ? 8 : 12;
|
|
2625
2539
|
break;
|
|
2626
2540
|
case 4:
|
|
2627
2541
|
request.uri = "".concat(request.uri, "/").concat(_constants.CALL_HOLD_SERVICE, "/").concat(_constants.HOLD_ENDPOINT);
|
|
2628
|
-
return
|
|
2542
|
+
return _context20.abrupt("break", 13);
|
|
2629
2543
|
case 6:
|
|
2630
2544
|
request.uri = "".concat(request.uri, "/").concat(_constants.CALL_HOLD_SERVICE, "/").concat(_constants.RESUME_ENDPOINT);
|
|
2631
|
-
return
|
|
2545
|
+
return _context20.abrupt("break", 13);
|
|
2632
2546
|
case 8:
|
|
2633
2547
|
request.uri = "".concat(request.uri, "/").concat(_constants.CALL_TRANSFER_SERVICE, "/").concat(_constants.TRANSFER_ENDPOINT);
|
|
2634
2548
|
transferContext = context;
|
|
@@ -2647,21 +2561,21 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2647
2561
|
transferType: _types4.TransferType.CONSULT
|
|
2648
2562
|
});
|
|
2649
2563
|
}
|
|
2650
|
-
return
|
|
2564
|
+
return _context20.abrupt("break", 13);
|
|
2651
2565
|
case 12:
|
|
2652
2566
|
_Logger.default.warn("Unknown type for PUT request: ".concat(type), {
|
|
2653
2567
|
file: _constants.CALL_FILE,
|
|
2654
2568
|
method: this.postSSRequest.name
|
|
2655
2569
|
});
|
|
2656
2570
|
case 13:
|
|
2657
|
-
return
|
|
2571
|
+
return _context20.abrupt("return", this.webex.request(request));
|
|
2658
2572
|
case 14:
|
|
2659
2573
|
case "end":
|
|
2660
|
-
return
|
|
2574
|
+
return _context20.stop();
|
|
2661
2575
|
}
|
|
2662
|
-
},
|
|
2576
|
+
}, _callee20, this);
|
|
2663
2577
|
}));
|
|
2664
|
-
function postSSRequest(
|
|
2578
|
+
function postSSRequest(_x21, _x22) {
|
|
2665
2579
|
return _postSSRequest.apply(this, arguments);
|
|
2666
2580
|
}
|
|
2667
2581
|
return postSSRequest;
|
|
@@ -2673,11 +2587,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2673
2587
|
}, {
|
|
2674
2588
|
key: "postStatus",
|
|
2675
2589
|
value: (function () {
|
|
2676
|
-
var _postStatus = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2677
|
-
return _regenerator.default.wrap(function
|
|
2678
|
-
while (1) switch (
|
|
2590
|
+
var _postStatus = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2591
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2592
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
2679
2593
|
case 0:
|
|
2680
|
-
return
|
|
2594
|
+
return _context21.abrupt("return", this.webex.request({
|
|
2681
2595
|
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),
|
|
2682
2596
|
method: _types2.HTTP_METHODS.POST,
|
|
2683
2597
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -2692,9 +2606,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2692
2606
|
}));
|
|
2693
2607
|
case 1:
|
|
2694
2608
|
case "end":
|
|
2695
|
-
return
|
|
2609
|
+
return _context21.stop();
|
|
2696
2610
|
}
|
|
2697
|
-
},
|
|
2611
|
+
}, _callee21, this);
|
|
2698
2612
|
}));
|
|
2699
2613
|
function postStatus() {
|
|
2700
2614
|
return _postStatus.apply(this, arguments);
|
|
@@ -2713,14 +2627,14 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2713
2627
|
}, {
|
|
2714
2628
|
key: "completeTransfer",
|
|
2715
2629
|
value: (function () {
|
|
2716
|
-
var _completeTransfer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2717
|
-
var
|
|
2718
|
-
var context, errData,
|
|
2719
|
-
return _regenerator.default.wrap(function
|
|
2720
|
-
while (1) switch (
|
|
2630
|
+
var _completeTransfer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(transferType, transferCallId, transferTarget) {
|
|
2631
|
+
var _this13 = this;
|
|
2632
|
+
var context, errData, _context22, _errData;
|
|
2633
|
+
return _regenerator.default.wrap(function _callee22$(_context23) {
|
|
2634
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2721
2635
|
case 0:
|
|
2722
2636
|
if (!(transferType === _types4.TransferType.BLIND && transferTarget)) {
|
|
2723
|
-
|
|
2637
|
+
_context23.next = 16;
|
|
2724
2638
|
break;
|
|
2725
2639
|
}
|
|
2726
2640
|
/* blind transfer */
|
|
@@ -2733,24 +2647,24 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2733
2647
|
transferorCallId: this.getCallId(),
|
|
2734
2648
|
destination: transferTarget
|
|
2735
2649
|
};
|
|
2736
|
-
|
|
2737
|
-
|
|
2650
|
+
_context23.prev = 3;
|
|
2651
|
+
_context23.next = 6;
|
|
2738
2652
|
return this.postSSRequest(context, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
|
|
2739
2653
|
case 6:
|
|
2740
2654
|
this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL, _types5.TRANSFER_ACTION.BLIND, _types5.METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
|
|
2741
|
-
|
|
2655
|
+
_context23.next = 14;
|
|
2742
2656
|
break;
|
|
2743
2657
|
case 9:
|
|
2744
|
-
|
|
2745
|
-
|
|
2658
|
+
_context23.prev = 9;
|
|
2659
|
+
_context23.t0 = _context23["catch"](3);
|
|
2746
2660
|
_Logger.default.warn("Blind Transfer failed for correlationId ".concat(this.getCorrelationId()), {
|
|
2747
2661
|
file: _constants.CALL_FILE,
|
|
2748
2662
|
method: this.completeTransfer.name
|
|
2749
2663
|
});
|
|
2750
|
-
errData =
|
|
2664
|
+
errData = _context23.t0;
|
|
2751
2665
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
2752
|
-
|
|
2753
|
-
|
|
2666
|
+
_this13.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
|
|
2667
|
+
_this13.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.BLIND);
|
|
2754
2668
|
}, _types.ERROR_LAYER.CALL_CONTROL,
|
|
2755
2669
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2756
2670
|
/* istanbul ignore next */
|
|
@@ -2758,11 +2672,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2758
2672
|
return undefined;
|
|
2759
2673
|
}, this.getCorrelationId(), errData, this.completeTransfer.name, _constants.CALL_FILE);
|
|
2760
2674
|
case 14:
|
|
2761
|
-
|
|
2675
|
+
_context23.next = 33;
|
|
2762
2676
|
break;
|
|
2763
2677
|
case 16:
|
|
2764
2678
|
if (!(transferType === _types4.TransferType.CONSULT && transferCallId)) {
|
|
2765
|
-
|
|
2679
|
+
_context23.next = 32;
|
|
2766
2680
|
break;
|
|
2767
2681
|
}
|
|
2768
2682
|
/* Consult transfer */
|
|
@@ -2771,28 +2685,28 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2771
2685
|
file: _constants.CALL_FILE,
|
|
2772
2686
|
method: this.completeTransfer.name
|
|
2773
2687
|
});
|
|
2774
|
-
|
|
2688
|
+
_context22 = {
|
|
2775
2689
|
transferorCallId: this.getCallId(),
|
|
2776
2690
|
transferToCallId: transferCallId
|
|
2777
2691
|
};
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
return this.postSSRequest(
|
|
2692
|
+
_context23.prev = 19;
|
|
2693
|
+
_context23.next = 22;
|
|
2694
|
+
return this.postSSRequest(_context22, _types3.SUPPLEMENTARY_SERVICES.TRANSFER);
|
|
2781
2695
|
case 22:
|
|
2782
2696
|
this.metricManager.submitCallMetric(_types5.METRIC_EVENT.CALL, _types5.TRANSFER_ACTION.CONSULT, _types5.METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);
|
|
2783
|
-
|
|
2697
|
+
_context23.next = 30;
|
|
2784
2698
|
break;
|
|
2785
2699
|
case 25:
|
|
2786
|
-
|
|
2787
|
-
|
|
2700
|
+
_context23.prev = 25;
|
|
2701
|
+
_context23.t1 = _context23["catch"](19);
|
|
2788
2702
|
_Logger.default.warn("Consult Transfer failed for correlationId ".concat(this.getCorrelationId()), {
|
|
2789
2703
|
file: _constants.CALL_FILE,
|
|
2790
2704
|
method: this.completeTransfer.name
|
|
2791
2705
|
});
|
|
2792
|
-
_errData =
|
|
2706
|
+
_errData = _context23.t1;
|
|
2793
2707
|
(0, _Utils.handleCallErrors)(function (error) {
|
|
2794
|
-
|
|
2795
|
-
|
|
2708
|
+
_this13.emit(_types3.CALL_EVENT_KEYS.TRANSFER_ERROR, error);
|
|
2709
|
+
_this13.submitCallErrorMetric(error, _types5.TRANSFER_ACTION.CONSULT);
|
|
2796
2710
|
}, _types.ERROR_LAYER.CALL_CONTROL,
|
|
2797
2711
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2798
2712
|
/* istanbul ignore next */
|
|
@@ -2800,7 +2714,7 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2800
2714
|
return undefined;
|
|
2801
2715
|
}, this.getCorrelationId(), _errData, this.completeTransfer.name, _constants.CALL_FILE);
|
|
2802
2716
|
case 30:
|
|
2803
|
-
|
|
2717
|
+
_context23.next = 33;
|
|
2804
2718
|
break;
|
|
2805
2719
|
case 32:
|
|
2806
2720
|
_Logger.default.warn("Invalid information received, transfer failed for correlationId: ".concat(this.getCorrelationId()), {
|
|
@@ -2809,11 +2723,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2809
2723
|
});
|
|
2810
2724
|
case 33:
|
|
2811
2725
|
case "end":
|
|
2812
|
-
return
|
|
2726
|
+
return _context23.stop();
|
|
2813
2727
|
}
|
|
2814
|
-
},
|
|
2728
|
+
}, _callee22, this, [[3, 9], [19, 25]]);
|
|
2815
2729
|
}));
|
|
2816
|
-
function completeTransfer(_x24, _x25
|
|
2730
|
+
function completeTransfer(_x23, _x24, _x25) {
|
|
2817
2731
|
return _completeTransfer.apply(this, arguments);
|
|
2818
2732
|
}
|
|
2819
2733
|
return completeTransfer;
|
|
@@ -2825,32 +2739,32 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2825
2739
|
}, {
|
|
2826
2740
|
key: "getCallStats",
|
|
2827
2741
|
value: (function () {
|
|
2828
|
-
var _getCallStats = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2742
|
+
var _getCallStats = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
2829
2743
|
var stats;
|
|
2830
|
-
return _regenerator.default.wrap(function
|
|
2831
|
-
while (1) switch (
|
|
2744
|
+
return _regenerator.default.wrap(function _callee23$(_context24) {
|
|
2745
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
2832
2746
|
case 0:
|
|
2833
|
-
|
|
2834
|
-
|
|
2747
|
+
_context24.prev = 0;
|
|
2748
|
+
_context24.next = 3;
|
|
2835
2749
|
return this.mediaConnection.getStats();
|
|
2836
2750
|
case 3:
|
|
2837
|
-
stats =
|
|
2838
|
-
|
|
2751
|
+
stats = _context24.sent;
|
|
2752
|
+
_context24.next = 9;
|
|
2839
2753
|
break;
|
|
2840
2754
|
case 6:
|
|
2841
|
-
|
|
2842
|
-
|
|
2755
|
+
_context24.prev = 6;
|
|
2756
|
+
_context24.t0 = _context24["catch"](0);
|
|
2843
2757
|
_Logger.default.warn('Stats collection failed, using dummy stats', {
|
|
2844
2758
|
file: _constants.CALL_FILE,
|
|
2845
2759
|
method: this.getCallStats.name
|
|
2846
2760
|
});
|
|
2847
2761
|
case 9:
|
|
2848
|
-
return
|
|
2762
|
+
return _context24.abrupt("return", (0, _Utils.parseMediaQualityStatistics)(stats));
|
|
2849
2763
|
case 10:
|
|
2850
2764
|
case "end":
|
|
2851
|
-
return
|
|
2765
|
+
return _context24.stop();
|
|
2852
2766
|
}
|
|
2853
|
-
},
|
|
2767
|
+
}, _callee23, this, [[0, 6]]);
|
|
2854
2768
|
}));
|
|
2855
2769
|
function getCallStats() {
|
|
2856
2770
|
return _getCallStats.apply(this, arguments);
|
|
@@ -2866,15 +2780,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2866
2780
|
}, {
|
|
2867
2781
|
key: "postMedia",
|
|
2868
2782
|
value: (function () {
|
|
2869
|
-
var _postMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2870
|
-
return _regenerator.default.wrap(function
|
|
2871
|
-
while (1) switch (
|
|
2783
|
+
var _postMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(roapMessage) {
|
|
2784
|
+
return _regenerator.default.wrap(function _callee24$(_context25) {
|
|
2785
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2872
2786
|
case 0:
|
|
2873
2787
|
_Logger.default.log('Posting message to Webex Calling', {
|
|
2874
2788
|
file: _constants.CALL_FILE,
|
|
2875
2789
|
method: this.postMedia.name
|
|
2876
2790
|
});
|
|
2877
|
-
return
|
|
2791
|
+
return _context25.abrupt("return", this.webex.request({
|
|
2878
2792
|
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),
|
|
2879
2793
|
method: _types2.HTTP_METHODS.POST,
|
|
2880
2794
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -2893,11 +2807,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2893
2807
|
}));
|
|
2894
2808
|
case 2:
|
|
2895
2809
|
case "end":
|
|
2896
|
-
return
|
|
2810
|
+
return _context25.stop();
|
|
2897
2811
|
}
|
|
2898
|
-
},
|
|
2812
|
+
}, _callee24, this);
|
|
2899
2813
|
}));
|
|
2900
|
-
function postMedia(
|
|
2814
|
+
function postMedia(_x26) {
|
|
2901
2815
|
return _postMedia.apply(this, arguments);
|
|
2902
2816
|
}
|
|
2903
2817
|
return postMedia;
|
|
@@ -2910,73 +2824,73 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2910
2824
|
}, {
|
|
2911
2825
|
key: "mediaRoapEventsListener",
|
|
2912
2826
|
value: function mediaRoapEventsListener() {
|
|
2913
|
-
var
|
|
2827
|
+
var _this14 = this;
|
|
2914
2828
|
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND,
|
|
2915
2829
|
/*#__PURE__*/
|
|
2916
2830
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2917
2831
|
function () {
|
|
2918
|
-
var
|
|
2832
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(event) {
|
|
2919
2833
|
var _event$roapMessage, _event$roapMessage2;
|
|
2920
2834
|
var mediaOk, sdpVideoPortZero;
|
|
2921
|
-
return _regenerator.default.wrap(function
|
|
2922
|
-
while (1) switch (
|
|
2835
|
+
return _regenerator.default.wrap(function _callee25$(_context26) {
|
|
2836
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2923
2837
|
case 0:
|
|
2924
2838
|
_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), {});
|
|
2925
2839
|
_Logger.default.info("SDP message to send : \n ".concat((_event$roapMessage2 = event.roapMessage) === null || _event$roapMessage2 === void 0 ? void 0 : _event$roapMessage2.sdp), {
|
|
2926
2840
|
file: _constants.CALL_FILE,
|
|
2927
|
-
method:
|
|
2841
|
+
method: _this14.mediaRoapEventsListener.name
|
|
2928
2842
|
});
|
|
2929
|
-
|
|
2930
|
-
|
|
2843
|
+
_context26.t0 = event.roapMessage.messageType;
|
|
2844
|
+
_context26.next = _context26.t0 === _types4.RoapScenario.OK ? 5 : _context26.t0 === _types4.RoapScenario.OFFER ? 8 : _context26.t0 === _types4.RoapScenario.ANSWER ? 13 : _context26.t0 === _types4.RoapScenario.ERROR ? 16 : _context26.t0 === _types4.RoapScenario.OFFER_RESPONSE ? 18 : 21;
|
|
2931
2845
|
break;
|
|
2932
2846
|
case 5:
|
|
2933
2847
|
mediaOk = {
|
|
2934
2848
|
received: false,
|
|
2935
2849
|
message: event.roapMessage
|
|
2936
2850
|
};
|
|
2937
|
-
|
|
2851
|
+
_this14.sendMediaStateMachineEvt({
|
|
2938
2852
|
type: 'E_ROAP_OK',
|
|
2939
2853
|
data: mediaOk
|
|
2940
2854
|
});
|
|
2941
|
-
return
|
|
2855
|
+
return _context26.abrupt("break", 21);
|
|
2942
2856
|
case 8:
|
|
2943
2857
|
// TODO: Remove these after the Media-Core adds the fix
|
|
2944
2858
|
sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\d+) /gim, 'm=$1 0 ');
|
|
2945
2859
|
event.roapMessage.sdp = sdpVideoPortZero;
|
|
2946
|
-
|
|
2947
|
-
|
|
2860
|
+
_this14.localRoapMessage = event.roapMessage;
|
|
2861
|
+
_this14.sendCallStateMachineEvt({
|
|
2948
2862
|
type: 'E_SEND_CALL_SETUP',
|
|
2949
2863
|
data: event.roapMessage
|
|
2950
2864
|
});
|
|
2951
|
-
return
|
|
2865
|
+
return _context26.abrupt("break", 21);
|
|
2952
2866
|
case 13:
|
|
2953
|
-
|
|
2954
|
-
|
|
2867
|
+
_this14.localRoapMessage = event.roapMessage;
|
|
2868
|
+
_this14.sendMediaStateMachineEvt({
|
|
2955
2869
|
type: 'E_SEND_ROAP_ANSWER',
|
|
2956
2870
|
data: event.roapMessage
|
|
2957
2871
|
});
|
|
2958
|
-
return
|
|
2872
|
+
return _context26.abrupt("break", 21);
|
|
2959
2873
|
case 16:
|
|
2960
|
-
|
|
2874
|
+
_this14.sendMediaStateMachineEvt({
|
|
2961
2875
|
type: 'E_ROAP_ERROR',
|
|
2962
2876
|
data: event.roapMessage
|
|
2963
2877
|
});
|
|
2964
|
-
return
|
|
2878
|
+
return _context26.abrupt("break", 21);
|
|
2965
2879
|
case 18:
|
|
2966
|
-
|
|
2967
|
-
|
|
2880
|
+
_this14.localRoapMessage = event.roapMessage;
|
|
2881
|
+
_this14.sendMediaStateMachineEvt({
|
|
2968
2882
|
type: 'E_SEND_ROAP_OFFER',
|
|
2969
2883
|
data: event.roapMessage
|
|
2970
2884
|
});
|
|
2971
|
-
return
|
|
2885
|
+
return _context26.abrupt("break", 21);
|
|
2972
2886
|
case 21:
|
|
2973
2887
|
case "end":
|
|
2974
|
-
return
|
|
2888
|
+
return _context26.stop();
|
|
2975
2889
|
}
|
|
2976
|
-
},
|
|
2890
|
+
}, _callee25);
|
|
2977
2891
|
}));
|
|
2978
|
-
return function (
|
|
2979
|
-
return
|
|
2892
|
+
return function (_x27) {
|
|
2893
|
+
return _ref6.apply(this, arguments);
|
|
2980
2894
|
};
|
|
2981
2895
|
}());
|
|
2982
2896
|
}
|
|
@@ -2988,11 +2902,11 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
2988
2902
|
}, {
|
|
2989
2903
|
key: "mediaTrackListener",
|
|
2990
2904
|
value: function mediaTrackListener() {
|
|
2991
|
-
var
|
|
2905
|
+
var _this15 = this;
|
|
2992
2906
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2993
2907
|
this.mediaConnection.on(_internalMediaCore.MediaConnectionEventNames.REMOTE_TRACK_ADDED, function (e) {
|
|
2994
2908
|
if (e.type === _types3.MEDIA_CONNECTION_EVENT_KEYS.MEDIA_TYPE_AUDIO) {
|
|
2995
|
-
|
|
2909
|
+
_this15.emit(_types3.CALL_EVENT_KEYS.REMOTE_MEDIA, e.track);
|
|
2996
2910
|
}
|
|
2997
2911
|
});
|
|
2998
2912
|
}
|
|
@@ -3026,16 +2940,16 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3026
2940
|
}, {
|
|
3027
2941
|
key: "delete",
|
|
3028
2942
|
value: function () {
|
|
3029
|
-
var _delete2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2943
|
+
var _delete2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
3030
2944
|
var disconnectMetrics;
|
|
3031
|
-
return _regenerator.default.wrap(function
|
|
3032
|
-
while (1) switch (
|
|
2945
|
+
return _regenerator.default.wrap(function _callee26$(_context27) {
|
|
2946
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
3033
2947
|
case 0:
|
|
3034
|
-
|
|
2948
|
+
_context27.next = 2;
|
|
3035
2949
|
return this.getCallStats();
|
|
3036
2950
|
case 2:
|
|
3037
|
-
disconnectMetrics =
|
|
3038
|
-
return
|
|
2951
|
+
disconnectMetrics = _context27.sent;
|
|
2952
|
+
return _context27.abrupt("return", this.webex.request({
|
|
3039
2953
|
uri: "".concat(this.mobiusUrl).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(this.deviceId, "/").concat(_constants.CALLS_ENDPOINT_RESOURCE, "/").concat(this.callId),
|
|
3040
2954
|
method: _types2.HTTP_METHODS.DELETE,
|
|
3041
2955
|
service: _types2.ALLOWED_SERVICES.MOBIUS,
|
|
@@ -3053,9 +2967,9 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3053
2967
|
}));
|
|
3054
2968
|
case 4:
|
|
3055
2969
|
case "end":
|
|
3056
|
-
return
|
|
2970
|
+
return _context27.stop();
|
|
3057
2971
|
}
|
|
3058
|
-
},
|
|
2972
|
+
}, _callee26, this);
|
|
3059
2973
|
}));
|
|
3060
2974
|
function _delete() {
|
|
3061
2975
|
return _delete2.apply(this, arguments);
|
|
@@ -3232,10 +3146,10 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3232
3146
|
}, {
|
|
3233
3147
|
key: "handleTimeout",
|
|
3234
3148
|
value: (function () {
|
|
3235
|
-
var _handleTimeout = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
3149
|
+
var _handleTimeout = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
3236
3150
|
var response;
|
|
3237
|
-
return _regenerator.default.wrap(function
|
|
3238
|
-
while (1) switch (
|
|
3151
|
+
return _regenerator.default.wrap(function _callee27$(_context28) {
|
|
3152
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
3239
3153
|
case 0:
|
|
3240
3154
|
_Logger.default.warn("Call timed out", {
|
|
3241
3155
|
file: _constants.CALL_FILE,
|
|
@@ -3243,19 +3157,19 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3243
3157
|
});
|
|
3244
3158
|
this.deleteCb(this.getCorrelationId());
|
|
3245
3159
|
this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());
|
|
3246
|
-
|
|
3160
|
+
_context28.next = 5;
|
|
3247
3161
|
return this.delete();
|
|
3248
3162
|
case 5:
|
|
3249
|
-
response =
|
|
3163
|
+
response = _context28.sent;
|
|
3250
3164
|
_Logger.default.log("handleTimeout: Response code: ".concat(response.statusCode), {
|
|
3251
3165
|
file: _constants.CALL_FILE,
|
|
3252
3166
|
method: this.handleTimeout.name
|
|
3253
3167
|
});
|
|
3254
3168
|
case 7:
|
|
3255
3169
|
case "end":
|
|
3256
|
-
return
|
|
3170
|
+
return _context28.stop();
|
|
3257
3171
|
}
|
|
3258
|
-
},
|
|
3172
|
+
}, _callee27, this);
|
|
3259
3173
|
}));
|
|
3260
3174
|
function handleTimeout() {
|
|
3261
3175
|
return _handleTimeout.apply(this, arguments);
|
|
@@ -3268,15 +3182,15 @@ var Call = exports.Call = /*#__PURE__*/function (_Eventing) {
|
|
|
3268
3182
|
/**
|
|
3269
3183
|
* @param activeUrl
|
|
3270
3184
|
* @param webex -.
|
|
3185
|
+
* @param dest -.
|
|
3271
3186
|
* @param dir -.
|
|
3272
3187
|
* @param deviceId -.
|
|
3273
3188
|
* @param lineId -.
|
|
3274
3189
|
* @param serverCb
|
|
3275
3190
|
* @param deleteCb
|
|
3276
3191
|
* @param indicator - Service Indicator.
|
|
3277
|
-
* @param dest -.
|
|
3278
3192
|
*/
|
|
3279
|
-
var createCall = exports.createCall = function createCall(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator
|
|
3280
|
-
return new Call(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator
|
|
3193
|
+
var createCall = exports.createCall = function createCall(activeUrl, webex, dest, dir, deviceId, lineId, deleteCb, indicator) {
|
|
3194
|
+
return new Call(activeUrl, webex, dest, dir, deviceId, lineId, deleteCb, indicator);
|
|
3281
3195
|
};
|
|
3282
3196
|
//# sourceMappingURL=call.js.map
|