@webex/calling 3.0.0-next.17 → 3.0.0-next.19

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.
@@ -68,6 +68,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
68
68
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaConnection", void 0);
69
69
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "earlyMedia", void 0);
70
70
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "connected", void 0);
71
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaInactivity", void 0);
71
72
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callerInfo", void 0);
72
73
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "localRoapMessage", void 0);
73
74
  // Use it for new offer
@@ -223,6 +224,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
223
224
  _this.correlationId = (0, _uuid.v4)();
224
225
  _this.deleteCb = deleteCb;
225
226
  _this.connected = false;
227
+ _this.mediaInactivity = false;
226
228
  _this.held = false;
227
229
  _this.earlyMedia = false;
228
230
  _this.callerInfo = {};
@@ -230,7 +232,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
230
232
  _this.mobiusUrl = activeUrl;
231
233
  _this.receivedRoapOKSeq = 0;
232
234
  _this.mediaNegotiationCompleted = false;
233
- _Logger.default.info("Mobius Url:- ".concat(_this.mobiusUrl), {
235
+ _Logger.default.info("Webex Calling Url:- ".concat(_this.mobiusUrl), {
234
236
  file: _constants.CALL_FILE,
235
237
  method: 'constructor'
236
238
  });
@@ -959,7 +961,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
959
961
  case 10:
960
962
  _context2.prev = 10;
961
963
  _context2.t0 = _context2["catch"](2);
962
- _Logger.default.warn('Call setup failed with Mobius', {
964
+ _Logger.default.warn('Failed to setup the call', {
963
965
  file: _constants.CALL_FILE,
964
966
  method: this.handleOutgoingCallSetup.name
965
967
  });
@@ -1050,7 +1052,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1050
1052
  case 9:
1051
1053
  _context4.prev = 9;
1052
1054
  _context4.t0 = _context4["catch"](1);
1053
- _Logger.default.warn('Call Hold failed with Mobius', {
1055
+ _Logger.default.warn('Failed to put the call on hold', {
1054
1056
  file: _constants.CALL_FILE,
1055
1057
  method: this.handleCallHold.name
1056
1058
  });
@@ -1141,7 +1143,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1141
1143
  case 9:
1142
1144
  _context6.prev = 9;
1143
1145
  _context6.t0 = _context6["catch"](1);
1144
- _Logger.default.warn('Call Resume failed with Mobius', {
1146
+ _Logger.default.warn('Failed to resume the call', {
1145
1147
  file: _constants.CALL_FILE,
1146
1148
  method: this.handleCallResume.name
1147
1149
  });
@@ -1277,7 +1279,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1277
1279
  case 8:
1278
1280
  _context7.prev = 8;
1279
1281
  _context7.t0 = _context7["catch"](1);
1280
- _Logger.default.warn('Call Progress failed with Mobius', {
1282
+ _Logger.default.warn('Failed to signal call progression', {
1281
1283
  file: _constants.CALL_FILE,
1282
1284
  method: this.handleOutgoingCallAlerting.name
1283
1285
  });
@@ -1364,22 +1366,24 @@ var Call = /*#__PURE__*/function (_Eventing) {
1364
1366
  return _context8.abrupt("return");
1365
1367
  case 4:
1366
1368
  _context8.prev = 4;
1367
- _context8.next = 7;
1369
+ /* Start Offer/Answer as we might have buffered the offer by now */
1370
+ this.mediaConnection.roapMessageReceived(this.remoteRoapMessage);
1371
+
1372
+ /* send call_connect PATCH */
1373
+ _context8.next = 8;
1368
1374
  return this.patch(_types4.MobiusCallState.CONNECTED);
1369
- case 7:
1375
+ case 8:
1370
1376
  res = _context8.sent;
1371
1377
  _Logger.default.log("PATCH response: ".concat(res.statusCode), {
1372
1378
  file: _constants.CALL_FILE,
1373
1379
  method: this.handleOutgoingCallConnect.name
1374
1380
  });
1375
- /* Start Offer/Answer as we might have buffered the offer by now */
1376
- this.mediaConnection.roapMessageReceived(this.remoteRoapMessage);
1377
1381
  _context8.next = 17;
1378
1382
  break;
1379
1383
  case 12:
1380
1384
  _context8.prev = 12;
1381
1385
  _context8.t0 = _context8["catch"](4);
1382
- _Logger.default.warn('Call Connect failed with Mobius', {
1386
+ _Logger.default.warn('Failed to connect the call', {
1383
1387
  file: _constants.CALL_FILE,
1384
1388
  method: this.handleOutgoingCallConnect.name
1385
1389
  });
@@ -1441,7 +1445,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1441
1445
  case 9:
1442
1446
  _context9.prev = 9;
1443
1447
  _context9.t0 = _context9["catch"](2);
1444
- _Logger.default.warn('Delete Call failed with Mobius', {
1448
+ _Logger.default.warn('Failed to delete the call', {
1445
1449
  file: _constants.CALL_FILE,
1446
1450
  method: this.handleIncomingCallDisconnect.name
1447
1451
  });
@@ -1508,7 +1512,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1508
1512
  case 8:
1509
1513
  _context10.prev = 8;
1510
1514
  _context10.t0 = _context10["catch"](1);
1511
- _Logger.default.warn('Delete Call failed with Mobius', {
1515
+ _Logger.default.warn('Failed to delete the call', {
1512
1516
  file: _constants.CALL_FILE,
1513
1517
  method: this.handleOutgoingCallDisconnect.name
1514
1518
  });
@@ -1671,7 +1675,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1671
1675
  case 11:
1672
1676
  _context12.prev = 11;
1673
1677
  _context12.t0 = _context12["catch"](3);
1674
- _Logger.default.warn('Delete Call failed with Mobius', {
1678
+ _Logger.default.warn('Failed to delete the call', {
1675
1679
  file: _constants.CALL_FILE,
1676
1680
  method: this.handleUnknownState.name
1677
1681
  });
@@ -1815,7 +1819,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1815
1819
  case 15:
1816
1820
  _context13.prev = 15;
1817
1821
  _context13.t0 = _context13["catch"](5);
1818
- _Logger.default.warn('MediaOk failed with Mobius', {
1822
+ _Logger.default.warn('Failed to process MediaOk request', {
1819
1823
  file: _constants.CALL_FILE,
1820
1824
  method: 'handleRoapEstablished'
1821
1825
  });
@@ -1917,7 +1921,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
1917
1921
  case 10:
1918
1922
  _context14.prev = 10;
1919
1923
  _context14.t0 = _context14["catch"](3);
1920
- _Logger.default.warn('Failed to communicate ROAP error with Mobius', {
1924
+ _Logger.default.warn('Failed to communicate ROAP error to Webex Calling', {
1921
1925
  file: _constants.CALL_FILE,
1922
1926
  method: this.handleRoapError.name
1923
1927
  });
@@ -2002,7 +2006,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
2002
2006
  case 13:
2003
2007
  _context15.prev = 13;
2004
2008
  _context15.t0 = _context15["catch"](6);
2005
- _Logger.default.warn('MediaOk failed with Mobius', {
2009
+ _Logger.default.warn('Failed to process MediaOk request', {
2006
2010
  file: _constants.CALL_FILE,
2007
2011
  method: this.handleOutgoingRoapOffer.name
2008
2012
  });
@@ -2064,7 +2068,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
2064
2068
  case 10:
2065
2069
  _context16.prev = 10;
2066
2070
  _context16.t0 = _context16["catch"](2);
2067
- _Logger.default.warn('MediaAnswer failed with Mobius', {
2071
+ _Logger.default.warn('Failed to send MediaAnswer request', {
2068
2072
  file: _constants.CALL_FILE,
2069
2073
  method: this.handleOutgoingRoapAnswer.name
2070
2074
  });
@@ -2217,7 +2221,10 @@ var Call = /*#__PURE__*/function (_Eventing) {
2217
2221
  *
2218
2222
  */
2219
2223
  function setDisconnectReason() {
2220
- if (this.connected || this.direction === _types2.CallDirection.OUTBOUND) {
2224
+ if (this.mediaInactivity) {
2225
+ this.disconnectReason.code = _types4.DisconnectCode.MEDIA_INACTIVITY;
2226
+ this.disconnectReason.cause = _types4.DisconnectCause.MEDIA_INACTIVITY;
2227
+ } else if (this.connected || this.direction === _types2.CallDirection.OUTBOUND) {
2221
2228
  this.disconnectReason.code = _types4.DisconnectCode.NORMAL;
2222
2229
  this.disconnectReason.cause = _types4.DisconnectCause.NORMAL;
2223
2230
  } else {
@@ -2240,6 +2247,20 @@ var Call = /*#__PURE__*/function (_Eventing) {
2240
2247
  while (1) switch (_context17.prev = _context17.next) {
2241
2248
  case 0:
2242
2249
  localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
2250
+ if (localAudioTrack) {
2251
+ _context17.next = 6;
2252
+ break;
2253
+ }
2254
+ _Logger.default.warn("Did not find a local track while answering the call ".concat(this.getCorrelationId()), {
2255
+ file: _constants.CALL_FILE,
2256
+ method: 'answer'
2257
+ });
2258
+ this.mediaInactivity = true;
2259
+ this.sendCallStateMachineEvt({
2260
+ type: 'E_SEND_CALL_DISCONNECT'
2261
+ });
2262
+ return _context17.abrupt("return");
2263
+ case 6:
2243
2264
  localAudioTrack.enabled = true;
2244
2265
  if (!this.mediaConnection) {
2245
2266
  this.initMediaConnection(localAudioTrack);
@@ -2257,7 +2278,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
2257
2278
  method: 'answer'
2258
2279
  });
2259
2280
  }
2260
- case 4:
2281
+ case 9:
2261
2282
  case "end":
2262
2283
  return _context17.stop();
2263
2284
  }
@@ -2281,6 +2302,18 @@ var Call = /*#__PURE__*/function (_Eventing) {
2281
2302
  while (1) switch (_context18.prev = _context18.next) {
2282
2303
  case 0:
2283
2304
  localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];
2305
+ if (localAudioTrack) {
2306
+ _context18.next = 6;
2307
+ break;
2308
+ }
2309
+ _Logger.default.warn("Did not find a local track while dialling the call ".concat(this.getCorrelationId()), {
2310
+ file: _constants.CALL_FILE,
2311
+ method: 'dial'
2312
+ });
2313
+ this.deleteCb(this.getCorrelationId());
2314
+ this.emit(_types3.CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());
2315
+ return _context18.abrupt("return");
2316
+ case 6:
2284
2317
  localAudioTrack.enabled = true;
2285
2318
  if (!this.mediaConnection) {
2286
2319
  this.initMediaConnection(localAudioTrack);
@@ -2298,7 +2331,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
2298
2331
  method: 'dial'
2299
2332
  });
2300
2333
  }
2301
- case 4:
2334
+ case 9:
2302
2335
  case "end":
2303
2336
  return _context18.stop();
2304
2337
  }
@@ -2323,7 +2356,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
2323
2356
  return _regenerator.default.wrap(function _callee19$(_context19) {
2324
2357
  while (1) switch (_context19.prev = _context19.next) {
2325
2358
  case 0:
2326
- _Logger.default.info("Send a PATCH for ".concat(state, " to mobius"), {
2359
+ _Logger.default.info("Send a PATCH for ".concat(state, " to Webex Calling"), {
2327
2360
  file: _constants.CALL_FILE,
2328
2361
  method: this.patch.name
2329
2362
  });
@@ -2631,7 +2664,7 @@ var Call = /*#__PURE__*/function (_Eventing) {
2631
2664
  return _regenerator.default.wrap(function _callee24$(_context25) {
2632
2665
  while (1) switch (_context25.prev = _context25.next) {
2633
2666
  case 0:
2634
- _Logger.default.log('Posting message to mobius', {
2667
+ _Logger.default.log('Posting message to Webex Calling', {
2635
2668
  file: _constants.CALL_FILE,
2636
2669
  method: this.postMedia.name
2637
2670
  });