@webex/calling 3.5.0 → 3.6.0

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