@webex/calling 3.12.0-next.8 → 3.12.0-task-refactor.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/CallHistory/CallHistory.js +51 -68
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallingClient/CallingClient.js +18 -115
  4. package/dist/CallingClient/CallingClient.js.map +1 -1
  5. package/dist/CallingClient/CallingClient.test.js +6 -121
  6. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  7. package/dist/CallingClient/calling/call.js +9 -10
  8. package/dist/CallingClient/calling/call.js.map +1 -1
  9. package/dist/CallingClient/calling/call.test.js +379 -520
  10. package/dist/CallingClient/calling/call.test.js.map +1 -1
  11. package/dist/CallingClient/calling/callManager.js +0 -7
  12. package/dist/CallingClient/calling/callManager.js.map +1 -1
  13. package/dist/CallingClient/constants.js +2 -4
  14. package/dist/CallingClient/constants.js.map +1 -1
  15. package/dist/CallingClient/registration/register.js +0 -16
  16. package/dist/CallingClient/registration/register.js.map +1 -1
  17. package/dist/CallingClient/registration/types.js.map +1 -1
  18. package/dist/CallingClient/types.js.map +1 -1
  19. package/dist/Events/types.js +11 -1
  20. package/dist/Events/types.js.map +1 -1
  21. package/dist/common/Utils.js +0 -2
  22. package/dist/common/Utils.js.map +1 -1
  23. package/dist/common/Utils.test.js +2 -2
  24. package/dist/common/Utils.test.js.map +1 -1
  25. package/dist/common/types.js.map +1 -1
  26. package/dist/module/CallHistory/CallHistory.js +17 -28
  27. package/dist/module/CallingClient/CallingClient.js +1 -43
  28. package/dist/module/CallingClient/calling/call.js +3 -4
  29. package/dist/module/CallingClient/calling/callManager.js +0 -7
  30. package/dist/module/CallingClient/constants.js +0 -2
  31. package/dist/module/CallingClient/registration/register.js +0 -8
  32. package/dist/module/Events/types.js +10 -0
  33. package/dist/module/common/Utils.js +0 -2
  34. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  35. package/dist/types/CallingClient/CallingClient.d.ts +1 -2
  36. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  37. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  38. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  39. package/dist/types/CallingClient/constants.d.ts +0 -2
  40. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  41. package/dist/types/CallingClient/registration/register.d.ts +1 -2
  42. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  43. package/dist/types/CallingClient/registration/types.d.ts +1 -2
  44. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  45. package/dist/types/CallingClient/types.d.ts +1 -2
  46. package/dist/types/CallingClient/types.d.ts.map +1 -1
  47. package/dist/types/Events/types.d.ts +10 -0
  48. package/dist/types/Events/types.d.ts.map +1 -1
  49. package/dist/types/common/Utils.d.ts.map +1 -1
  50. package/dist/types/common/types.d.ts +0 -4
  51. package/dist/types/common/types.d.ts.map +1 -1
  52. package/package.json +4 -4
@@ -8,11 +8,10 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
9
9
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
10
10
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
11
- var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
12
11
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
13
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
14
13
  var InternalMediaCoreModule = _interopRequireWildcard(require("@webex/internal-media-core"));
15
- var _mediaHelpers = require("@webex/media-helpers");
14
+ var _webMediaEffects = require("@webex/web-media-effects");
16
15
  var _types = require("../../Errors/types");
17
16
  var _Utils = _interopRequireWildcard(require("../../common/Utils"));
18
17
  var Utils = _Utils;
@@ -463,8 +462,8 @@ describe('Call Tests', function () {
463
462
  bnrMetricSpy.mockClear();
464
463
  /* Invoking the callback function to trigger EffectAdded event to simulate adding effect to the stream */
465
464
  onStreamSpy.mock.calls[1][1](mockEffect);
466
- expect(onEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Enabled, expect.any(Function));
467
- expect(onEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
465
+ expect(onEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Enabled, expect.any(Function));
466
+ expect(onEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Disabled, expect.any(Function));
468
467
 
469
468
  /* Send Enabled event on the effect, update track and send metrics for BNR disabled */
470
469
  onStreamSpy.mock.calls[0][1](mockTrack);
@@ -494,8 +493,8 @@ describe('Call Tests', function () {
494
493
  expect(offStreamSpy).toBeCalledTimes(2);
495
494
  expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.OutputTrackChange, expect.any(Function));
496
495
  expect(offStreamSpy).toBeCalledWith(InternalMediaCoreModule.LocalStreamEventNames.EffectAdded, expect.any(Function));
497
- expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Enabled, expect.any(Function));
498
- expect(offEffectSpy).toBeCalledWith(_mediaHelpers.EffectEvent.Disabled, expect.any(Function));
496
+ expect(offEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Enabled, expect.any(Function));
497
+ expect(offEffectSpy).toBeCalledWith(_webMediaEffects.EffectEvent.Disabled, expect.any(Function));
499
498
  case 2:
500
499
  case "end":
501
500
  return _context9.stop();
@@ -879,9 +878,7 @@ describe('State Machine handler tests', function () {
879
878
  _context14.next = 2;
880
879
  return _promise.default.resolve();
881
880
  case 2:
882
- // clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
883
- // and once in handleCallKeepaliveError when clearing timer due to error
884
- expect(clearInterval).toHaveBeenCalledTimes(2);
881
+ expect(clearInterval).toHaveBeenCalledTimes(1);
885
882
  expect(funcSpy).toBeCalledTimes(1);
886
883
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
887
884
  case 3:
@@ -915,9 +912,7 @@ describe('State Machine handler tests', function () {
915
912
  _context15.next = 1;
916
913
  return (0, _testUtil.flushPromises)(2);
917
914
  case 1:
918
- // clearInterval is called twice: once in scheduleCallKeepaliveInterval (at start)
919
- // and once in handleCallKeepaliveError when clearing timer due to error
920
- expect(clearInterval).toHaveBeenCalledTimes(2);
915
+ expect(clearInterval).toHaveBeenCalledTimes(1);
921
916
  expect(funcSpy).toBeCalledTimes(1);
922
917
  case 2:
923
918
  case "end":
@@ -964,45 +959,10 @@ describe('State Machine handler tests', function () {
964
959
  }
965
960
  }, _callee16);
966
961
  })));
967
- it('scheduleCallKeepaliveInterval clears existing interval before creating new one', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
968
- var firstTimer, secondTimer;
962
+ it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
963
+ var errorPayload, warnSpy, postStatusSpy;
969
964
  return _regenerator.default.wrap(function (_context17) {
970
965
  while (1) switch (_context17.prev = _context17.next) {
971
- case 0:
972
- jest.spyOn(global, 'setInterval');
973
- jest.spyOn(global, 'clearInterval');
974
-
975
- // Setup the first keepalive interval
976
- call['handleCallEstablished']({});
977
-
978
- // At this point, scheduleCallKeepaliveInterval was called once
979
- // It should have called clearInterval once (at the start) and setInterval once
980
- expect(clearInterval).toHaveBeenCalledTimes(1);
981
- expect(setInterval).toHaveBeenCalledTimes(1);
982
- firstTimer = call['sessionTimer'];
983
- expect(firstTimer).toBeDefined();
984
-
985
- // Manually call scheduleCallKeepaliveInterval again to simulate a retry scenario
986
- call['scheduleCallKeepaliveInterval']();
987
-
988
- // clearInterval should have been called again to clear the previous timer
989
- expect(clearInterval).toHaveBeenCalledTimes(2);
990
- // A new interval should have been created
991
- expect(setInterval).toHaveBeenCalledTimes(2);
992
-
993
- // The sessionTimer should be different (new timer)
994
- secondTimer = call['sessionTimer'];
995
- expect(secondTimer).toBeDefined();
996
- case 1:
997
- case "end":
998
- return _context17.stop();
999
- }
1000
- }, _callee17);
1001
- })));
1002
- it('keepalive ends after reaching max retry count', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
1003
- var errorPayload, warnSpy, postStatusSpy;
1004
- return _regenerator.default.wrap(function (_context18) {
1005
- while (1) switch (_context18.prev = _context18.next) {
1006
966
  case 0:
1007
967
  errorPayload = {
1008
968
  statusCode: 500,
@@ -1021,25 +981,25 @@ describe('State Machine handler tests', function () {
1021
981
 
1022
982
  // Advance timer to trigger the first failure (uses DEFAULT_SESSION_TIMER)
1023
983
  jest.advanceTimersByTime(_constants.DEFAULT_SESSION_TIMER);
1024
- _context18.next = 1;
984
+ _context17.next = 1;
1025
985
  return (0, _testUtil.flushPromises)(2);
1026
986
  case 1:
1027
987
  // Now advance by 1 second for each of the 4 retry attempts (retry-after: 1 second each)
1028
988
  // Need to do this separately to allow state machine to process and create new intervals
1029
989
  jest.advanceTimersByTime(1000);
1030
- _context18.next = 2;
990
+ _context17.next = 2;
1031
991
  return (0, _testUtil.flushPromises)(2);
1032
992
  case 2:
1033
993
  jest.advanceTimersByTime(1000);
1034
- _context18.next = 3;
994
+ _context17.next = 3;
1035
995
  return (0, _testUtil.flushPromises)(2);
1036
996
  case 3:
1037
997
  jest.advanceTimersByTime(1000);
1038
- _context18.next = 4;
998
+ _context17.next = 4;
1039
999
  return (0, _testUtil.flushPromises)(2);
1040
1000
  case 4:
1041
1001
  jest.advanceTimersByTime(1000);
1042
- _context18.next = 5;
1002
+ _context17.next = 5;
1043
1003
  return (0, _testUtil.flushPromises)(2);
1044
1004
  case 5:
1045
1005
  // The error handler should detect we're at max retry count and stop
@@ -1051,14 +1011,14 @@ describe('State Machine handler tests', function () {
1051
1011
  expect(call['callKeepaliveRetryCount']).toBe(4);
1052
1012
  case 6:
1053
1013
  case "end":
1054
- return _context18.stop();
1014
+ return _context17.stop();
1055
1015
  }
1056
- }, _callee18);
1016
+ }, _callee17);
1057
1017
  })));
1058
- it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
1018
+ it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
1059
1019
  var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
1060
- return _regenerator.default.wrap(function (_context19) {
1061
- while (1) switch (_context19.prev = _context19.next) {
1020
+ return _regenerator.default.wrap(function (_context18) {
1021
+ while (1) switch (_context18.prev = _context18.next) {
1062
1022
  case 0:
1063
1023
  statusPayload = {
1064
1024
  statusCode: 200,
@@ -1114,14 +1074,14 @@ describe('State Machine handler tests', function () {
1114
1074
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1115
1075
  case 1:
1116
1076
  case "end":
1117
- return _context19.stop();
1077
+ return _context18.stop();
1118
1078
  }
1119
- }, _callee19);
1079
+ }, _callee18);
1120
1080
  })));
1121
- it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1081
+ it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
1122
1082
  var statusPayload, dummyEvent;
1123
- return _regenerator.default.wrap(function (_context20) {
1124
- while (1) switch (_context20.prev = _context20.next) {
1083
+ return _regenerator.default.wrap(function (_context19) {
1084
+ while (1) switch (_context19.prev = _context19.next) {
1125
1085
  case 0:
1126
1086
  call['direction'] = _types3.CallDirection.INBOUND;
1127
1087
  statusPayload = {
@@ -1139,7 +1099,7 @@ describe('State Machine handler tests', function () {
1139
1099
  webex.request.mockReturnValue(statusPayload);
1140
1100
  call.sendCallStateMachineEvt(dummyEvent);
1141
1101
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
1142
- _context20.next = 1;
1102
+ _context19.next = 1;
1143
1103
  return call['handleOutgoingCallConnect']({
1144
1104
  type: 'E_SEND_CALL_CONNECT'
1145
1105
  });
@@ -1153,115 +1113,14 @@ describe('State Machine handler tests', function () {
1153
1113
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1154
1114
  case 2:
1155
1115
  case "end":
1156
- return _context20.stop();
1157
- }
1158
- }, _callee20);
1159
- })));
1160
- it('processes callerId on received progress event in established state without emitting PROGRESS', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1161
- var callManager, statusPayload, call, dummyEvent, dummyOkEvent, emitSpy, startCallerIdSpy, mobiusProgressEvent;
1162
- return _regenerator.default.wrap(function (_context21) {
1163
- while (1) switch (_context21.prev = _context21.next) {
1164
- case 0:
1165
- callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
1166
- statusPayload = {
1167
- statusCode: 200,
1168
- body: mockStatusBody
1169
- };
1170
- call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
1171
- webex.request.mockReturnValue(statusPayload);
1172
-
1173
- // Move to S_SEND_CALL_SETUP
1174
- dummyEvent = {
1175
- type: 'E_SEND_CALL_SETUP',
1176
- data: {
1177
- seq: 1,
1178
- message: {},
1179
- type: 'OFFER'
1180
- }
1181
- };
1182
- call.sendCallStateMachineEvt(dummyEvent);
1183
- expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
1184
-
1185
- // Complete media negotiation to allow connect -> established
1186
- // Ask media SDK to initiate offer
1187
- dummyEvent.type = 'E_SEND_ROAP_OFFER';
1188
- dummyEvent.data = {
1189
- seq: 1,
1190
- messageType: 'OFFER',
1191
- sdp: 'sdp'
1192
- };
1193
- call.sendMediaStateMachineEvt(dummyEvent);
1194
- expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
1195
- dummyEvent.type = 'E_RECV_ROAP_ANSWER';
1196
- dummyEvent.data = {
1197
- seq: 1,
1198
- messageType: 'ANSWER',
1199
- sdp: 'sdp'
1200
- };
1201
- call.sendMediaStateMachineEvt(dummyEvent);
1202
- expect(call['mediaStateMachine'].state.value).toBe('S_RECV_ROAP_ANSWER');
1203
- // Send OK
1204
- dummyOkEvent = {
1205
- type: 'E_ROAP_OK',
1206
- data: {
1207
- received: false,
1208
- message: {
1209
- seq: 1,
1210
- messageType: 'OK'
1211
- }
1212
- }
1213
- };
1214
- call.sendMediaStateMachineEvt(dummyOkEvent);
1215
- expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_OK');
1216
- expect(call['mediaNegotiationCompleted']).toBe(true);
1217
-
1218
- // Move call to established
1219
- dummyEvent.type = 'E_RECV_CALL_CONNECT';
1220
- dummyEvent.data = undefined;
1221
- call.sendCallStateMachineEvt(dummyEvent);
1222
- expect(call['callStateMachine'].state.value).toBe('S_CALL_ESTABLISHED');
1223
- emitSpy = jest.spyOn(call, 'emit');
1224
- startCallerIdSpy = jest.spyOn(call, 'startCallerIdResolution'); // Now send progress with callerId while established via CallManager (Mobius event)
1225
- mobiusProgressEvent = {
1226
- id: 'evt1',
1227
- timestamp: (0, _now.default)(),
1228
- trackingId: 'track-1',
1229
- data: {
1230
- eventType: _types5.MobiusEventType.CALL_PROGRESS,
1231
- callerId: {
1232
- from: '"Bob Marley" <sip:5010@207.182.171.130;user=phone>;tag=888068389-1654853820619-'
1233
- },
1234
- callProgressData: {
1235
- inbandMedia: true,
1236
- alerting: false
1237
- },
1238
- callId: call.getCallId(),
1239
- callUrl: 'https://mobius.example/call',
1240
- deviceId: deviceId,
1241
- correlationId: call.getCorrelationId()
1242
- }
1243
- };
1244
- callManager['dequeueWsEvents'](mobiusProgressEvent);
1245
-
1246
- // CallerId resolution should be triggered exactly once (handled by CallManager)
1247
- expect(startCallerIdSpy).toBeCalledOnceWith(mobiusProgressEvent.data.callerId);
1248
- // Since it returns early in established state, PROGRESS event should not be emitted here
1249
- expect(emitSpy.mock.calls.find(function (args) {
1250
- return args && args[0] === _types2.CALL_EVENT_KEYS.PROGRESS;
1251
- })).toBeUndefined();
1252
- expect(call['callStateMachine'].state.value).not.toBe('S_RECV_CALL_PROGRESS');
1253
- // Early media flag should not be set due to early return
1254
- expect(call.earlyMedia).not.toBe(true);
1255
- case 1:
1256
- case "end":
1257
- return _context21.stop();
1116
+ return _context19.stop();
1258
1117
  }
1259
- }, _callee21);
1118
+ }, _callee19);
1260
1119
  })));
1261
- it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1120
+ it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
1262
1121
  var warnSpy, errorSpy, stateMachineSpy, statusPayload, roapMessage;
1263
- return _regenerator.default.wrap(function (_context22) {
1264
- while (1) switch (_context22.prev = _context22.next) {
1122
+ return _regenerator.default.wrap(function (_context20) {
1123
+ while (1) switch (_context20.prev = _context20.next) {
1265
1124
  case 0:
1266
1125
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1267
1126
  errorSpy = jest.spyOn(_Logger.default, 'error');
@@ -1288,7 +1147,7 @@ describe('State Machine handler tests', function () {
1288
1147
  webex.request.mockRejectedValueOnce({
1289
1148
  statusCode: 403
1290
1149
  }).mockResolvedValue(statusPayload);
1291
- _context22.next = 1;
1150
+ _context20.next = 1;
1292
1151
  return call['handleOutgoingCallConnect']({
1293
1152
  type: 'E_SEND_CALL_CONNECT'
1294
1153
  });
@@ -1299,14 +1158,14 @@ describe('State Machine handler tests', function () {
1299
1158
  expect(errorSpy).toBeCalledTimes(1);
1300
1159
  case 2:
1301
1160
  case "end":
1302
- return _context22.stop();
1161
+ return _context20.stop();
1303
1162
  }
1304
- }, _callee22);
1163
+ }, _callee20);
1305
1164
  })));
1306
- it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1165
+ it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1307
1166
  var statusPayload, dummyEvent, postMediaSpy, logSpy, dummyOkEvent;
1308
- return _regenerator.default.wrap(function (_context23) {
1309
- while (1) switch (_context23.prev = _context23.next) {
1167
+ return _regenerator.default.wrap(function (_context21) {
1168
+ while (1) switch (_context21.prev = _context21.next) {
1310
1169
  case 0:
1311
1170
  statusPayload = {
1312
1171
  statusCode: 200,
@@ -1382,14 +1241,14 @@ describe('State Machine handler tests', function () {
1382
1241
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1383
1242
  case 1:
1384
1243
  case "end":
1385
- return _context23.stop();
1244
+ return _context21.stop();
1386
1245
  }
1387
- }, _callee23);
1246
+ }, _callee21);
1388
1247
  })));
1389
- it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1248
+ it('outgoing call where we receive connect directly after setup. Media established before connect. test call and media state changes', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1390
1249
  var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
1391
- return _regenerator.default.wrap(function (_context24) {
1392
- while (1) switch (_context24.prev = _context24.next) {
1250
+ return _regenerator.default.wrap(function (_context22) {
1251
+ while (1) switch (_context22.prev = _context22.next) {
1393
1252
  case 0:
1394
1253
  statusPayload = {
1395
1254
  statusCode: 200,
@@ -1457,14 +1316,14 @@ describe('State Machine handler tests', function () {
1457
1316
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1458
1317
  case 1:
1459
1318
  case "end":
1460
- return _context24.stop();
1319
+ return _context22.stop();
1461
1320
  }
1462
- }, _callee24);
1321
+ }, _callee22);
1463
1322
  })));
1464
- it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1323
+ it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1465
1324
  var statusPayload, dummyEvent;
1466
- return _regenerator.default.wrap(function (_context25) {
1467
- while (1) switch (_context25.prev = _context25.next) {
1325
+ return _regenerator.default.wrap(function (_context23) {
1326
+ while (1) switch (_context23.prev = _context23.next) {
1468
1327
  case 0:
1469
1328
  statusPayload = {
1470
1329
  statusCode: 200,
@@ -1503,14 +1362,14 @@ describe('State Machine handler tests', function () {
1503
1362
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1504
1363
  case 1:
1505
1364
  case "end":
1506
- return _context25.stop();
1365
+ return _context23.stop();
1507
1366
  }
1508
- }, _callee25);
1367
+ }, _callee23);
1509
1368
  })));
1510
- it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1369
+ it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1511
1370
  var statusPayload, dummyEvent, errorSpy;
1512
- return _regenerator.default.wrap(function (_context26) {
1513
- while (1) switch (_context26.prev = _context26.next) {
1371
+ return _regenerator.default.wrap(function (_context24) {
1372
+ while (1) switch (_context24.prev = _context24.next) {
1514
1373
  case 0:
1515
1374
  statusPayload = {
1516
1375
  statusCode: 403,
@@ -1527,7 +1386,7 @@ describe('State Machine handler tests', function () {
1527
1386
  webex.request.mockRejectedValueOnce(statusPayload);
1528
1387
  errorSpy = jest.spyOn(_Logger.default, 'error');
1529
1388
  call.sendCallStateMachineEvt(dummyEvent);
1530
- _context26.next = 1;
1389
+ _context24.next = 1;
1531
1390
  return (0, _testUtil.flushPromises)(3);
1532
1391
  case 1:
1533
1392
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
@@ -1538,14 +1397,14 @@ describe('State Machine handler tests', function () {
1538
1397
  });
1539
1398
  case 2:
1540
1399
  case "end":
1541
- return _context26.stop();
1400
+ return _context24.stop();
1542
1401
  }
1543
- }, _callee26);
1402
+ }, _callee24);
1544
1403
  })));
1545
- it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1404
+ it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1546
1405
  var statusPayload, dummyEvent, warnSpy;
1547
- return _regenerator.default.wrap(function (_context27) {
1548
- while (1) switch (_context27.prev = _context27.next) {
1406
+ return _regenerator.default.wrap(function (_context25) {
1407
+ while (1) switch (_context25.prev = _context25.next) {
1549
1408
  case 0:
1550
1409
  statusPayload = {
1551
1410
  statusCode: 403,
@@ -1564,10 +1423,10 @@ describe('State Machine handler tests', function () {
1564
1423
  webex.request.mockRejectedValue(statusPayload);
1565
1424
  warnSpy = jest.spyOn(_Logger.default, 'warn');
1566
1425
  jest.spyOn(Utils, 'uploadLogs').mockResolvedValue(undefined);
1567
- _context27.next = 1;
1426
+ _context25.next = 1;
1568
1427
  return call['handleRoapEstablished']({}, dummyEvent);
1569
1428
  case 1:
1570
- _context27.next = 2;
1429
+ _context25.next = 2;
1571
1430
  return (0, _testUtil.flushPromises)(2);
1572
1431
  case 2:
1573
1432
  expect(call.isConnected()).toBe(false);
@@ -1583,14 +1442,14 @@ describe('State Machine handler tests', function () {
1583
1442
  });
1584
1443
  case 3:
1585
1444
  case "end":
1586
- return _context27.stop();
1445
+ return _context25.stop();
1587
1446
  }
1588
- }, _callee27);
1447
+ }, _callee25);
1589
1448
  })));
1590
- it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1449
+ it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1591
1450
  var statusPayload, dummyEvent;
1592
- return _regenerator.default.wrap(function (_context28) {
1593
- while (1) switch (_context28.prev = _context28.next) {
1451
+ return _regenerator.default.wrap(function (_context26) {
1452
+ while (1) switch (_context26.prev = _context26.next) {
1594
1453
  case 0:
1595
1454
  statusPayload = {
1596
1455
  statusCode: 403,
@@ -1613,14 +1472,14 @@ describe('State Machine handler tests', function () {
1613
1472
  expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
1614
1473
  case 1:
1615
1474
  case "end":
1616
- return _context28.stop();
1475
+ return _context26.stop();
1617
1476
  }
1618
- }, _callee28);
1477
+ }, _callee26);
1619
1478
  })));
1620
- it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1479
+ it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1621
1480
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1622
- return _regenerator.default.wrap(function (_context29) {
1623
- while (1) switch (_context29.prev = _context29.next) {
1481
+ return _regenerator.default.wrap(function (_context27) {
1482
+ while (1) switch (_context27.prev = _context27.next) {
1624
1483
  case 0:
1625
1484
  statusPayload = {
1626
1485
  statusCode: 503,
@@ -1642,7 +1501,7 @@ describe('State Machine handler tests', function () {
1642
1501
  }
1643
1502
  };
1644
1503
  call['connected'] = true;
1645
- _context29.next = 1;
1504
+ _context27.next = 1;
1646
1505
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1647
1506
  case 1:
1648
1507
  jest.advanceTimersByTime(1005);
@@ -1654,14 +1513,14 @@ describe('State Machine handler tests', function () {
1654
1513
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1655
1514
  case 2:
1656
1515
  case "end":
1657
- return _context29.stop();
1516
+ return _context27.stop();
1658
1517
  }
1659
- }, _callee29);
1518
+ }, _callee27);
1660
1519
  })));
1661
- it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1520
+ it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1662
1521
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1663
- return _regenerator.default.wrap(function (_context30) {
1664
- while (1) switch (_context30.prev = _context30.next) {
1522
+ return _regenerator.default.wrap(function (_context28) {
1523
+ while (1) switch (_context28.prev = _context28.next) {
1665
1524
  case 0:
1666
1525
  statusPayload = {
1667
1526
  statusCode: 503,
@@ -1683,7 +1542,7 @@ describe('State Machine handler tests', function () {
1683
1542
  }
1684
1543
  };
1685
1544
  call['connected'] = false;
1686
- _context30.next = 1;
1545
+ _context28.next = 1;
1687
1546
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1688
1547
  case 1:
1689
1548
  jest.advanceTimersByTime(1005);
@@ -1694,14 +1553,14 @@ describe('State Machine handler tests', function () {
1694
1553
  expect(stateMachineSpy).not.toBeCalled();
1695
1554
  case 2:
1696
1555
  case "end":
1697
- return _context30.stop();
1556
+ return _context28.stop();
1698
1557
  }
1699
- }, _callee30);
1558
+ }, _callee28);
1700
1559
  })));
1701
- it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1560
+ it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1702
1561
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1703
- return _regenerator.default.wrap(function (_context31) {
1704
- while (1) switch (_context31.prev = _context31.next) {
1562
+ return _regenerator.default.wrap(function (_context29) {
1563
+ while (1) switch (_context29.prev = _context29.next) {
1705
1564
  case 0:
1706
1565
  statusPayload = {
1707
1566
  statusCode: 503,
@@ -1723,7 +1582,7 @@ describe('State Machine handler tests', function () {
1723
1582
  };
1724
1583
  call['connected'] = true;
1725
1584
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
1726
- _context31.next = 1;
1585
+ _context29.next = 1;
1727
1586
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1728
1587
  case 1:
1729
1588
  jest.advanceTimersByTime(1005);
@@ -1735,14 +1594,14 @@ describe('State Machine handler tests', function () {
1735
1594
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1736
1595
  case 2:
1737
1596
  case "end":
1738
- return _context31.stop();
1597
+ return _context29.stop();
1739
1598
  }
1740
- }, _callee31);
1599
+ }, _callee29);
1741
1600
  })));
1742
- it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1601
+ it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1743
1602
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1744
- return _regenerator.default.wrap(function (_context32) {
1745
- while (1) switch (_context32.prev = _context32.next) {
1603
+ return _regenerator.default.wrap(function (_context30) {
1604
+ while (1) switch (_context30.prev = _context30.next) {
1746
1605
  case 0:
1747
1606
  statusPayload = {
1748
1607
  statusCode: 503,
@@ -1763,7 +1622,7 @@ describe('State Machine handler tests', function () {
1763
1622
  }
1764
1623
  };
1765
1624
  call['connected'] = false;
1766
- _context32.next = 1;
1625
+ _context30.next = 1;
1767
1626
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1768
1627
  case 1:
1769
1628
  jest.advanceTimersByTime(1005);
@@ -1775,14 +1634,14 @@ describe('State Machine handler tests', function () {
1775
1634
  expect(stateMachineSpy).not.toBeCalled();
1776
1635
  case 2:
1777
1636
  case "end":
1778
- return _context32.stop();
1637
+ return _context30.stop();
1779
1638
  }
1780
- }, _callee32);
1639
+ }, _callee30);
1781
1640
  })));
1782
- it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1641
+ it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1783
1642
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1784
- return _regenerator.default.wrap(function (_context33) {
1785
- while (1) switch (_context33.prev = _context33.next) {
1643
+ return _regenerator.default.wrap(function (_context31) {
1644
+ while (1) switch (_context31.prev = _context31.next) {
1786
1645
  case 0:
1787
1646
  statusPayload = {
1788
1647
  statusCode: 200,
@@ -1807,14 +1666,14 @@ describe('State Machine handler tests', function () {
1807
1666
  expect(stateMachineSpy).not.toHaveBeenCalled();
1808
1667
  case 1:
1809
1668
  case "end":
1810
- return _context33.stop();
1669
+ return _context31.stop();
1811
1670
  }
1812
- }, _callee33);
1671
+ }, _callee31);
1813
1672
  })));
1814
- it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1673
+ it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1815
1674
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1816
- return _regenerator.default.wrap(function (_context34) {
1817
- while (1) switch (_context34.prev = _context34.next) {
1675
+ return _regenerator.default.wrap(function (_context32) {
1676
+ while (1) switch (_context32.prev = _context32.next) {
1818
1677
  case 0:
1819
1678
  statusPayload = {
1820
1679
  statusCode: 503,
@@ -1836,7 +1695,7 @@ describe('State Machine handler tests', function () {
1836
1695
  };
1837
1696
  call['connected'] = true;
1838
1697
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1839
- _context34.next = 1;
1698
+ _context32.next = 1;
1840
1699
  return call['handleRoapEstablished']({}, dummyEvent);
1841
1700
  case 1:
1842
1701
  jest.advanceTimersByTime(1005);
@@ -1848,14 +1707,14 @@ describe('State Machine handler tests', function () {
1848
1707
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1849
1708
  case 2:
1850
1709
  case "end":
1851
- return _context34.stop();
1710
+ return _context32.stop();
1852
1711
  }
1853
- }, _callee34);
1712
+ }, _callee32);
1854
1713
  })));
1855
- it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1714
+ it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1856
1715
  var statusPayload, stateMachineSpy, funcSpy, errorEvent;
1857
- return _regenerator.default.wrap(function (_context35) {
1858
- while (1) switch (_context35.prev = _context35.next) {
1716
+ return _regenerator.default.wrap(function (_context33) {
1717
+ while (1) switch (_context33.prev = _context33.next) {
1859
1718
  case 0:
1860
1719
  statusPayload = {
1861
1720
  statusCode: 403,
@@ -1878,14 +1737,14 @@ describe('State Machine handler tests', function () {
1878
1737
  expect(stateMachineSpy).not.toHaveBeenCalled();
1879
1738
  case 1:
1880
1739
  case "end":
1881
- return _context35.stop();
1740
+ return _context33.stop();
1882
1741
  }
1883
- }, _callee35);
1742
+ }, _callee33);
1884
1743
  })));
1885
- it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1744
+ it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
1886
1745
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1887
- return _regenerator.default.wrap(function (_context36) {
1888
- while (1) switch (_context36.prev = _context36.next) {
1746
+ return _regenerator.default.wrap(function (_context34) {
1747
+ while (1) switch (_context34.prev = _context34.next) {
1889
1748
  case 0:
1890
1749
  statusPayload = {
1891
1750
  statusCode: 200,
@@ -1903,7 +1762,7 @@ describe('State Machine handler tests', function () {
1903
1762
  }
1904
1763
  };
1905
1764
  call['connected'] = false;
1906
- _context36.next = 1;
1765
+ _context34.next = 1;
1907
1766
  return call['handleRoapError']({}, errorEvent);
1908
1767
  case 1:
1909
1768
  expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
@@ -1919,14 +1778,14 @@ describe('State Machine handler tests', function () {
1919
1778
  });
1920
1779
  case 2:
1921
1780
  case "end":
1922
- return _context36.stop();
1781
+ return _context34.stop();
1923
1782
  }
1924
- }, _callee36);
1783
+ }, _callee34);
1925
1784
  })));
1926
- it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
1785
+ it('incoming call: failing ROAP_ANSWER posts error path and tears down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
1927
1786
  var statusPayload, warnSpy, postMediaSpy, setupEvent, connectEvent, offerEvent, answerEvent;
1928
- return _regenerator.default.wrap(function (_context37) {
1929
- while (1) switch (_context37.prev = _context37.next) {
1787
+ return _regenerator.default.wrap(function (_context35) {
1788
+ while (1) switch (_context35.prev = _context35.next) {
1930
1789
  case 0:
1931
1790
  statusPayload = {
1932
1791
  statusCode: 403,
@@ -1964,10 +1823,10 @@ describe('State Machine handler tests', function () {
1964
1823
  messageType: 'ANSWER'
1965
1824
  }
1966
1825
  };
1967
- _context37.next = 1;
1826
+ _context35.next = 1;
1968
1827
  return call.sendMediaStateMachineEvt(answerEvent);
1969
1828
  case 1:
1970
- _context37.next = 2;
1829
+ _context35.next = 2;
1971
1830
  return (0, _testUtil.flushPromises)(2);
1972
1831
  case 2:
1973
1832
  expect(postMediaSpy).toBeCalledOnceWith(answerEvent.data);
@@ -1985,14 +1844,14 @@ describe('State Machine handler tests', function () {
1985
1844
  expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
1986
1845
  case 3:
1987
1846
  case "end":
1988
- return _context37.stop();
1847
+ return _context35.stop();
1989
1848
  }
1990
- }, _callee37);
1849
+ }, _callee35);
1991
1850
  })));
1992
- it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
1851
+ it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
1993
1852
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1994
- return _regenerator.default.wrap(function (_context38) {
1995
- while (1) switch (_context38.prev = _context38.next) {
1853
+ return _regenerator.default.wrap(function (_context36) {
1854
+ while (1) switch (_context36.prev = _context36.next) {
1996
1855
  case 0:
1997
1856
  statusPayload = {
1998
1857
  statusCode: 200,
@@ -2025,7 +1884,7 @@ describe('State Machine handler tests', function () {
2025
1884
  seq: 1,
2026
1885
  messageType: 'ANSWER'
2027
1886
  };
2028
- _context38.next = 1;
1887
+ _context36.next = 1;
2029
1888
  return call.sendMediaStateMachineEvt(dummyEvent);
2030
1889
  case 1:
2031
1890
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -2047,7 +1906,7 @@ describe('State Machine handler tests', function () {
2047
1906
  seq: 2,
2048
1907
  messageType: 'OFFER_REQUEST'
2049
1908
  };
2050
- _context38.next = 2;
1909
+ _context36.next = 2;
2051
1910
  return call.sendMediaStateMachineEvt(dummyEvent);
2052
1911
  case 2:
2053
1912
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -2097,7 +1956,7 @@ describe('State Machine handler tests', function () {
2097
1956
  };
2098
1957
  call.sendCallStateMachineEvt(dummyEvent);
2099
1958
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
2100
- _context38.next = 3;
1959
+ _context36.next = 3;
2101
1960
  return call.sendMediaStateMachineEvt(dummyEvent);
2102
1961
  case 3:
2103
1962
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2106,7 +1965,7 @@ describe('State Machine handler tests', function () {
2106
1965
  seq: 3,
2107
1966
  messageType: 'ANSWER'
2108
1967
  };
2109
- _context38.next = 4;
1968
+ _context36.next = 4;
2110
1969
  return call.sendMediaStateMachineEvt(dummyEvent);
2111
1970
  case 4:
2112
1971
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2125,7 +1984,7 @@ describe('State Machine handler tests', function () {
2125
1984
  messageType: 'OK'
2126
1985
  }
2127
1986
  };
2128
- _context38.next = 5;
1987
+ _context36.next = 5;
2129
1988
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2130
1989
  case 5:
2131
1990
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
@@ -2140,14 +1999,14 @@ describe('State Machine handler tests', function () {
2140
1999
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2141
2000
  case 6:
2142
2001
  case "end":
2143
- return _context38.stop();
2002
+ return _context36.stop();
2144
2003
  }
2145
- }, _callee38);
2004
+ }, _callee36);
2146
2005
  })));
2147
- it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2006
+ it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
2148
2007
  var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
2149
- return _regenerator.default.wrap(function (_context39) {
2150
- while (1) switch (_context39.prev = _context39.next) {
2008
+ return _regenerator.default.wrap(function (_context37) {
2009
+ while (1) switch (_context37.prev = _context37.next) {
2151
2010
  case 0:
2152
2011
  mockStatusBody = {
2153
2012
  device: {
@@ -2187,7 +2046,7 @@ describe('State Machine handler tests', function () {
2187
2046
  seq: 1,
2188
2047
  messageType: 'ANSWER'
2189
2048
  };
2190
- _context39.next = 1;
2049
+ _context37.next = 1;
2191
2050
  return call.sendMediaStateMachineEvt(dummyEvent);
2192
2051
  case 1:
2193
2052
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -2209,7 +2068,7 @@ describe('State Machine handler tests', function () {
2209
2068
  seq: 2,
2210
2069
  messageType: 'OFFER_REQUEST'
2211
2070
  };
2212
- _context39.next = 2;
2071
+ _context37.next = 2;
2213
2072
  return call.sendMediaStateMachineEvt(dummyEvent);
2214
2073
  case 2:
2215
2074
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -2259,7 +2118,7 @@ describe('State Machine handler tests', function () {
2259
2118
  };
2260
2119
  call.sendCallStateMachineEvt(dummyEvent);
2261
2120
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
2262
- _context39.next = 3;
2121
+ _context37.next = 3;
2263
2122
  return call.sendMediaStateMachineEvt(dummyEvent);
2264
2123
  case 3:
2265
2124
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2268,7 +2127,7 @@ describe('State Machine handler tests', function () {
2268
2127
  seq: 3,
2269
2128
  messageType: 'ANSWER'
2270
2129
  };
2271
- _context39.next = 4;
2130
+ _context37.next = 4;
2272
2131
  return call.sendMediaStateMachineEvt(dummyEvent);
2273
2132
  case 4:
2274
2133
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -2285,7 +2144,7 @@ describe('State Machine handler tests', function () {
2285
2144
  }
2286
2145
  };
2287
2146
  call.sendMediaStateMachineEvt(dummyEvent);
2288
- _context39.next = 5;
2147
+ _context37.next = 5;
2289
2148
  return call.sendMediaStateMachineEvt(dummyOkEvent);
2290
2149
  case 5:
2291
2150
  expect(call['receivedRoapOKSeq']).toBe(3);
@@ -2301,14 +2160,14 @@ describe('State Machine handler tests', function () {
2301
2160
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
2302
2161
  case 6:
2303
2162
  case "end":
2304
- return _context39.stop();
2163
+ return _context37.stop();
2305
2164
  }
2306
- }, _callee39);
2165
+ }, _callee37);
2307
2166
  })));
2308
- it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2167
+ it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38() {
2309
2168
  var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
2310
- return _regenerator.default.wrap(function (_context40) {
2311
- while (1) switch (_context40.prev = _context40.next) {
2169
+ return _regenerator.default.wrap(function (_context38) {
2170
+ while (1) switch (_context38.prev = _context38.next) {
2312
2171
  case 0:
2313
2172
  statusPayload = {
2314
2173
  statusCode: 200,
@@ -2375,14 +2234,14 @@ describe('State Machine handler tests', function () {
2375
2234
  });
2376
2235
  case 1:
2377
2236
  case "end":
2378
- return _context40.stop();
2237
+ return _context38.stop();
2379
2238
  }
2380
- }, _callee40);
2239
+ }, _callee38);
2381
2240
  })));
2382
- it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2241
+ it('emits DISCONNECT before mobius delete request is invoked', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39() {
2383
2242
  var emitSpy, deleteSpy;
2384
- return _regenerator.default.wrap(function (_context41) {
2385
- while (1) switch (_context41.prev = _context41.next) {
2243
+ return _regenerator.default.wrap(function (_context39) {
2244
+ while (1) switch (_context39.prev = _context39.next) {
2386
2245
  case 0:
2387
2246
  emitSpy = jest.spyOn(call, 'emit');
2388
2247
  deleteSpy = jest.spyOn(call, 'delete').mockResolvedValue({
@@ -2391,7 +2250,7 @@ describe('State Machine handler tests', function () {
2391
2250
  call.sendCallStateMachineEvt({
2392
2251
  type: 'E_RECV_CALL_DISCONNECT'
2393
2252
  });
2394
- _context41.next = 1;
2253
+ _context39.next = 1;
2395
2254
  return (0, _testUtil.flushPromises)(1);
2396
2255
  case 1:
2397
2256
  expect(emitSpy).toHaveBeenCalledWith(_types2.CALL_EVENT_KEYS.DISCONNECT, call.getCorrelationId());
@@ -2399,9 +2258,9 @@ describe('State Machine handler tests', function () {
2399
2258
  expect(emitSpy.mock.invocationCallOrder[0]).toBeLessThan(deleteSpy.mock.invocationCallOrder[0]);
2400
2259
  case 2:
2401
2260
  case "end":
2402
- return _context41.stop();
2261
+ return _context39.stop();
2403
2262
  }
2404
- }, _callee41);
2263
+ }, _callee39);
2405
2264
  })));
2406
2265
  describe('Call event timers tests', function () {
2407
2266
  var callManager;
@@ -2412,10 +2271,10 @@ describe('State Machine handler tests', function () {
2412
2271
  afterEach(function () {
2413
2272
  jest.clearAllTimers();
2414
2273
  });
2415
- it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42() {
2274
+ it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40() {
2416
2275
  var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
2417
- return _regenerator.default.wrap(function (_context42) {
2418
- while (1) switch (_context42.prev = _context42.next) {
2276
+ return _regenerator.default.wrap(function (_context40) {
2277
+ while (1) switch (_context40.prev = _context40.next) {
2419
2278
  case 0:
2420
2279
  statusPayload = {
2421
2280
  statusCode: 200,
@@ -2432,7 +2291,7 @@ describe('State Machine handler tests', function () {
2432
2291
  webex.request.mockReturnValue(statusPayload);
2433
2292
 
2434
2293
  // handleOutgoingCallSetup is asynchronous
2435
- _context42.next = 1;
2294
+ _context40.next = 1;
2436
2295
  return call.sendCallStateMachineEvt(dummyEvent);
2437
2296
  case 1:
2438
2297
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2475,14 +2334,14 @@ describe('State Machine handler tests', function () {
2475
2334
  expect(callManager.callCollection).toStrictEqual({});
2476
2335
  case 2:
2477
2336
  case "end":
2478
- return _context42.stop();
2337
+ return _context40.stop();
2479
2338
  }
2480
- }, _callee42);
2339
+ }, _callee40);
2481
2340
  })));
2482
- it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
2341
+ it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41() {
2483
2342
  var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
2484
- return _regenerator.default.wrap(function (_context43) {
2485
- while (1) switch (_context43.prev = _context43.next) {
2343
+ return _regenerator.default.wrap(function (_context41) {
2344
+ while (1) switch (_context41.prev = _context41.next) {
2486
2345
  case 0:
2487
2346
  statusPayload = {
2488
2347
  statusCode: 200,
@@ -2501,7 +2360,7 @@ describe('State Machine handler tests', function () {
2501
2360
  expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
2502
2361
 
2503
2362
  // handleOutgoingCallSetup is asynchronous
2504
- _context43.next = 1;
2363
+ _context41.next = 1;
2505
2364
  return call.sendCallStateMachineEvt(dummyEvent);
2506
2365
  case 1:
2507
2366
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2513,9 +2372,9 @@ describe('State Machine handler tests', function () {
2513
2372
  expect(callManager.callCollection).toStrictEqual({});
2514
2373
  case 2:
2515
2374
  case "end":
2516
- return _context43.stop();
2375
+ return _context41.stop();
2517
2376
  }
2518
- }, _callee43);
2377
+ }, _callee41);
2519
2378
  })));
2520
2379
  });
2521
2380
  });
@@ -2575,10 +2434,10 @@ describe('Supplementary Services tests', function () {
2575
2434
  beforeEach(function () {
2576
2435
  call.removeAllListeners();
2577
2436
  });
2578
- it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
2437
+ it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43() {
2579
2438
  var responsePayload, warnSpy, roapEvent;
2580
- return _regenerator.default.wrap(function (_context45) {
2581
- while (1) switch (_context45.prev = _context45.next) {
2439
+ return _regenerator.default.wrap(function (_context43) {
2440
+ while (1) switch (_context43.prev = _context43.next) {
2582
2441
  case 0:
2583
2442
  expect.assertions(7);
2584
2443
  responsePayload = {
@@ -2591,25 +2450,25 @@ describe('Supplementary Services tests', function () {
2591
2450
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2592
2451
  call['held'] = false;
2593
2452
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2594
- var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(correlationId) {
2595
- return _regenerator.default.wrap(function (_context44) {
2596
- while (1) switch (_context44.prev = _context44.next) {
2453
+ var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(correlationId) {
2454
+ return _regenerator.default.wrap(function (_context42) {
2455
+ while (1) switch (_context42.prev = _context42.next) {
2597
2456
  case 0:
2598
2457
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2599
2458
  case 1:
2600
2459
  case "end":
2601
- return _context44.stop();
2460
+ return _context42.stop();
2602
2461
  }
2603
- }, _callee44);
2462
+ }, _callee42);
2604
2463
  }));
2605
2464
  return function (_x) {
2606
- return _ref45.apply(this, arguments);
2465
+ return _ref43.apply(this, arguments);
2607
2466
  };
2608
2467
  }());
2609
- _context45.next = 1;
2468
+ _context43.next = 1;
2610
2469
  return call.doHoldResume();
2611
2470
  case 1:
2612
- _context45.next = 2;
2471
+ _context43.next = 2;
2613
2472
  return (0, _testUtil.flushPromises)(2);
2614
2473
  case 2:
2615
2474
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2625,11 +2484,11 @@ describe('Supplementary Services tests', function () {
2625
2484
  call['handleIncomingRoapOffer']({}, dummyEvent);
2626
2485
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2627
2486
  roapEvent.data.type = 'ANSWER';
2628
- _context45.next = 3;
2487
+ _context43.next = 3;
2629
2488
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2630
2489
  case 3:
2631
2490
  roapEvent.data.type = 'OK';
2632
- _context45.next = 4;
2491
+ _context43.next = 4;
2633
2492
  return call['handleRoapEstablished']({}, dummyEvent);
2634
2493
  case 4:
2635
2494
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2644,14 +2503,14 @@ describe('Supplementary Services tests', function () {
2644
2503
  });
2645
2504
  case 5:
2646
2505
  case "end":
2647
- return _context45.stop();
2506
+ return _context43.stop();
2648
2507
  }
2649
- }, _callee45);
2508
+ }, _callee43);
2650
2509
  })));
2651
- it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
2510
+ it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
2652
2511
  var responsePayload, warnSpy, roapEvent;
2653
- return _regenerator.default.wrap(function (_context47) {
2654
- while (1) switch (_context47.prev = _context47.next) {
2512
+ return _regenerator.default.wrap(function (_context45) {
2513
+ while (1) switch (_context45.prev = _context45.next) {
2655
2514
  case 0:
2656
2515
  expect.assertions(8);
2657
2516
  responsePayload = {
@@ -2664,26 +2523,26 @@ describe('Supplementary Services tests', function () {
2664
2523
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2665
2524
  call['held'] = false;
2666
2525
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2667
- var _ref47 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(correlationId) {
2668
- return _regenerator.default.wrap(function (_context46) {
2669
- while (1) switch (_context46.prev = _context46.next) {
2526
+ var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(correlationId) {
2527
+ return _regenerator.default.wrap(function (_context44) {
2528
+ while (1) switch (_context44.prev = _context44.next) {
2670
2529
  case 0:
2671
2530
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2672
2531
  case 1:
2673
2532
  case "end":
2674
- return _context46.stop();
2533
+ return _context44.stop();
2675
2534
  }
2676
- }, _callee46);
2535
+ }, _callee44);
2677
2536
  }));
2678
2537
  return function (_x2) {
2679
- return _ref47.apply(this, arguments);
2538
+ return _ref45.apply(this, arguments);
2680
2539
  };
2681
2540
  }());
2682
2541
  call.doHoldResume();
2683
- _context47.next = 1;
2542
+ _context45.next = 1;
2684
2543
  return _promise.default.resolve();
2685
2544
  case 1:
2686
- _context47.next = 2;
2545
+ _context45.next = 2;
2687
2546
  return _promise.default.resolve();
2688
2547
  case 2:
2689
2548
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2699,11 +2558,11 @@ describe('Supplementary Services tests', function () {
2699
2558
  call['handleIncomingRoapOffer']({}, dummyEvent);
2700
2559
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2701
2560
  roapEvent.data.type = 'ANSWER';
2702
- _context47.next = 3;
2561
+ _context45.next = 3;
2703
2562
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2704
2563
  case 3:
2705
2564
  roapEvent.data.type = 'OK';
2706
- _context47.next = 4;
2565
+ _context45.next = 4;
2707
2566
  return call['handleRoapEstablished']({}, dummyEvent);
2708
2567
  case 4:
2709
2568
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2718,14 +2577,14 @@ describe('Supplementary Services tests', function () {
2718
2577
  });
2719
2578
  case 5:
2720
2579
  case "end":
2721
- return _context47.stop();
2580
+ return _context45.stop();
2722
2581
  }
2723
- }, _callee47);
2582
+ }, _callee45);
2724
2583
  })));
2725
- it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
2584
+ it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
2726
2585
  var responsePayload;
2727
- return _regenerator.default.wrap(function (_context49) {
2728
- while (1) switch (_context49.prev = _context49.next) {
2586
+ return _regenerator.default.wrap(function (_context47) {
2587
+ while (1) switch (_context47.prev = _context47.next) {
2729
2588
  case 0:
2730
2589
  expect.assertions(4);
2731
2590
  responsePayload = {
@@ -2735,26 +2594,26 @@ describe('Supplementary Services tests', function () {
2735
2594
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2736
2595
  call['held'] = false;
2737
2596
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2738
- var _ref49 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
2739
- return _regenerator.default.wrap(function (_context48) {
2740
- while (1) switch (_context48.prev = _context48.next) {
2597
+ var _ref47 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(errObj) {
2598
+ return _regenerator.default.wrap(function (_context46) {
2599
+ while (1) switch (_context46.prev = _context46.next) {
2741
2600
  case 0:
2742
2601
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2743
2602
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2744
2603
  case 1:
2745
2604
  case "end":
2746
- return _context48.stop();
2605
+ return _context46.stop();
2747
2606
  }
2748
- }, _callee48);
2607
+ }, _callee46);
2749
2608
  }));
2750
2609
  return function (_x3) {
2751
- return _ref49.apply(this, arguments);
2610
+ return _ref47.apply(this, arguments);
2752
2611
  };
2753
2612
  }());
2754
- _context49.next = 1;
2613
+ _context47.next = 1;
2755
2614
  return call.doHoldResume();
2756
2615
  case 1:
2757
- _context49.next = 2;
2616
+ _context47.next = 2;
2758
2617
  return (0, _testUtil.flushPromises)(2);
2759
2618
  case 2:
2760
2619
  expect(call.isHeld()).toStrictEqual(false);
@@ -2764,14 +2623,14 @@ describe('Supplementary Services tests', function () {
2764
2623
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2765
2624
  case 3:
2766
2625
  case "end":
2767
- return _context49.stop();
2626
+ return _context47.stop();
2768
2627
  }
2769
- }, _callee49);
2628
+ }, _callee47);
2770
2629
  })));
2771
- it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
2630
+ it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee49() {
2772
2631
  var responsePayload, rejectPayload, roapEvent;
2773
- return _regenerator.default.wrap(function (_context51) {
2774
- while (1) switch (_context51.prev = _context51.next) {
2632
+ return _regenerator.default.wrap(function (_context49) {
2633
+ while (1) switch (_context49.prev = _context49.next) {
2775
2634
  case 0:
2776
2635
  expect.assertions(5);
2777
2636
  responsePayload = {
@@ -2785,24 +2644,24 @@ describe('Supplementary Services tests', function () {
2785
2644
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2786
2645
  call['held'] = false;
2787
2646
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2788
- var _ref51 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50(errObj) {
2789
- return _regenerator.default.wrap(function (_context50) {
2790
- while (1) switch (_context50.prev = _context50.next) {
2647
+ var _ref49 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
2648
+ return _regenerator.default.wrap(function (_context48) {
2649
+ while (1) switch (_context48.prev = _context48.next) {
2791
2650
  case 0:
2792
2651
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2793
2652
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2794
2653
  case 1:
2795
2654
  case "end":
2796
- return _context50.stop();
2655
+ return _context48.stop();
2797
2656
  }
2798
- }, _callee50);
2657
+ }, _callee48);
2799
2658
  }));
2800
2659
  return function (_x4) {
2801
- return _ref51.apply(this, arguments);
2660
+ return _ref49.apply(this, arguments);
2802
2661
  };
2803
2662
  }());
2804
2663
  call.doHoldResume();
2805
- _context51.next = 1;
2664
+ _context49.next = 1;
2806
2665
  return (0, _testUtil.flushPromises)(2);
2807
2666
  case 1:
2808
2667
  /* the Call State should transition to S_CALL_ESTABLISHED
@@ -2812,7 +2671,7 @@ describe('Supplementary Services tests', function () {
2812
2671
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2813
2672
  /* We are intentionally failing the ROAP ANSWER */
2814
2673
  roapEvent.data.type = 'ANSWER';
2815
- _context51.next = 2;
2674
+ _context49.next = 2;
2816
2675
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2817
2676
  case 2:
2818
2677
  expect(call.isHeld()).toStrictEqual(false);
@@ -2820,14 +2679,14 @@ describe('Supplementary Services tests', function () {
2820
2679
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2821
2680
  case 3:
2822
2681
  case "end":
2823
- return _context51.stop();
2682
+ return _context49.stop();
2824
2683
  }
2825
- }, _callee51);
2684
+ }, _callee49);
2826
2685
  })));
2827
- it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52() {
2686
+ it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee50() {
2828
2687
  var responsePayload, warnSpy, roapEvent;
2829
- return _regenerator.default.wrap(function (_context52) {
2830
- while (1) switch (_context52.prev = _context52.next) {
2688
+ return _regenerator.default.wrap(function (_context50) {
2689
+ while (1) switch (_context50.prev = _context50.next) {
2831
2690
  case 0:
2832
2691
  responsePayload = {
2833
2692
  statusCode: 200,
@@ -2838,10 +2697,10 @@ describe('Supplementary Services tests', function () {
2838
2697
  jest.spyOn(global, 'clearTimeout');
2839
2698
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2840
2699
  call['held'] = false;
2841
- _context52.next = 1;
2700
+ _context50.next = 1;
2842
2701
  return call.doHoldResume();
2843
2702
  case 1:
2844
- _context52.next = 2;
2703
+ _context50.next = 2;
2845
2704
  return (0, _testUtil.flushPromises)(2);
2846
2705
  case 2:
2847
2706
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2856,19 +2715,19 @@ describe('Supplementary Services tests', function () {
2856
2715
  call['handleIncomingRoapOffer']({}, dummyEvent);
2857
2716
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2858
2717
  roapEvent.data.type = 'ANSWER';
2859
- _context52.next = 3;
2718
+ _context50.next = 3;
2860
2719
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2861
2720
  case 3:
2862
2721
  jest.spyOn(webex, 'request').mockRejectedValue({
2863
2722
  statusCode: 403
2864
2723
  });
2865
2724
  roapEvent.data.type = 'OK';
2866
- _context52.next = 4;
2725
+ _context50.next = 4;
2867
2726
  return call['handleRoapEstablished']({}, dummyEvent);
2868
2727
  case 4:
2869
2728
  /* this is for coverage */
2870
2729
  call['callStateMachine'].state.value = 'S_CALL_HOLD';
2871
- _context52.next = 5;
2730
+ _context50.next = 5;
2872
2731
  return call['handleRoapEstablished']({}, dummyEvent);
2873
2732
  case 5:
2874
2733
  expect(call.isHeld()).toStrictEqual(false);
@@ -2880,14 +2739,14 @@ describe('Supplementary Services tests', function () {
2880
2739
  });
2881
2740
  case 6:
2882
2741
  case "end":
2883
- return _context52.stop();
2742
+ return _context50.stop();
2884
2743
  }
2885
- }, _callee52);
2744
+ }, _callee50);
2886
2745
  })));
2887
- it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
2746
+ it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee51() {
2888
2747
  var responsePayload, warnSpy, roapEvent;
2889
- return _regenerator.default.wrap(function (_context53) {
2890
- while (1) switch (_context53.prev = _context53.next) {
2748
+ return _regenerator.default.wrap(function (_context51) {
2749
+ while (1) switch (_context51.prev = _context51.next) {
2891
2750
  case 0:
2892
2751
  responsePayload = {
2893
2752
  statusCode: 200,
@@ -2898,10 +2757,10 @@ describe('Supplementary Services tests', function () {
2898
2757
  jest.spyOn(global, 'clearTimeout');
2899
2758
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2900
2759
  call['held'] = true;
2901
- _context53.next = 1;
2760
+ _context51.next = 1;
2902
2761
  return call.doHoldResume();
2903
2762
  case 1:
2904
- _context53.next = 2;
2763
+ _context51.next = 2;
2905
2764
  return (0, _testUtil.flushPromises)(2);
2906
2765
  case 2:
2907
2766
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2916,14 +2775,14 @@ describe('Supplementary Services tests', function () {
2916
2775
  call['handleIncomingRoapOffer']({}, dummyEvent);
2917
2776
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2918
2777
  roapEvent.data.type = 'ANSWER';
2919
- _context53.next = 3;
2778
+ _context51.next = 3;
2920
2779
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2921
2780
  case 3:
2922
2781
  jest.spyOn(webex, 'request').mockRejectedValue({
2923
2782
  statusCode: 403
2924
2783
  });
2925
2784
  roapEvent.data.type = 'OK';
2926
- _context53.next = 4;
2785
+ _context51.next = 4;
2927
2786
  return call['handleRoapEstablished']({}, dummyEvent);
2928
2787
  case 4:
2929
2788
  expect(call.isHeld()).toStrictEqual(true);
@@ -2935,14 +2794,14 @@ describe('Supplementary Services tests', function () {
2935
2794
  });
2936
2795
  case 5:
2937
2796
  case "end":
2938
- return _context53.stop();
2797
+ return _context51.stop();
2939
2798
  }
2940
- }, _callee53);
2799
+ }, _callee51);
2941
2800
  })));
2942
- it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
2801
+ it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee53() {
2943
2802
  var responsePayload, roapEvent;
2944
- return _regenerator.default.wrap(function (_context55) {
2945
- while (1) switch (_context55.prev = _context55.next) {
2803
+ return _regenerator.default.wrap(function (_context53) {
2804
+ while (1) switch (_context53.prev = _context53.next) {
2946
2805
  case 0:
2947
2806
  expect.assertions(5);
2948
2807
  responsePayload = {
@@ -2952,25 +2811,25 @@ describe('Supplementary Services tests', function () {
2952
2811
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2953
2812
  call['held'] = false;
2954
2813
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2955
- var _ref55 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
2956
- return _regenerator.default.wrap(function (_context54) {
2957
- while (1) switch (_context54.prev = _context54.next) {
2814
+ var _ref53 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
2815
+ return _regenerator.default.wrap(function (_context52) {
2816
+ while (1) switch (_context52.prev = _context52.next) {
2958
2817
  case 0:
2959
2818
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2960
2819
  expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
2961
2820
  case 1:
2962
2821
  case "end":
2963
- return _context54.stop();
2822
+ return _context52.stop();
2964
2823
  }
2965
- }, _callee54);
2824
+ }, _callee52);
2966
2825
  }));
2967
2826
  return function (_x5) {
2968
- return _ref55.apply(this, arguments);
2827
+ return _ref53.apply(this, arguments);
2969
2828
  };
2970
2829
  }());
2971
2830
  jest.runAllTimers();
2972
2831
  call.doHoldResume();
2973
- _context55.next = 1;
2832
+ _context53.next = 1;
2974
2833
  return (0, _testUtil.flushPromises)(2);
2975
2834
  case 1:
2976
2835
  /* At this point, the Call State should be S_CALL_HOLD
@@ -2983,11 +2842,11 @@ describe('Supplementary Services tests', function () {
2983
2842
  call['handleIncomingRoapOffer']({}, dummyEvent);
2984
2843
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2985
2844
  roapEvent.data.type = 'ANSWER';
2986
- _context55.next = 2;
2845
+ _context53.next = 2;
2987
2846
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2988
2847
  case 2:
2989
2848
  roapEvent.data.type = 'OK';
2990
- _context55.next = 3;
2849
+ _context53.next = 3;
2991
2850
  return call['handleRoapEstablished']({}, dummyEvent);
2992
2851
  case 3:
2993
2852
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2999,14 +2858,14 @@ describe('Supplementary Services tests', function () {
2999
2858
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3000
2859
  case 4:
3001
2860
  case "end":
3002
- return _context55.stop();
2861
+ return _context53.stop();
3003
2862
  }
3004
- }, _callee55);
2863
+ }, _callee53);
3005
2864
  })));
3006
- it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
2865
+ it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee55() {
3007
2866
  var responsePayload, warnSpy, roapEvent;
3008
- return _regenerator.default.wrap(function (_context57) {
3009
- while (1) switch (_context57.prev = _context57.next) {
2867
+ return _regenerator.default.wrap(function (_context55) {
2868
+ while (1) switch (_context55.prev = _context55.next) {
3010
2869
  case 0:
3011
2870
  expect.assertions(7);
3012
2871
  responsePayload = {
@@ -3019,25 +2878,25 @@ describe('Supplementary Services tests', function () {
3019
2878
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3020
2879
  call['held'] = true;
3021
2880
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
3022
- var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
3023
- return _regenerator.default.wrap(function (_context56) {
3024
- while (1) switch (_context56.prev = _context56.next) {
2881
+ var _ref55 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee54(correlationId) {
2882
+ return _regenerator.default.wrap(function (_context54) {
2883
+ while (1) switch (_context54.prev = _context54.next) {
3025
2884
  case 0:
3026
2885
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3027
2886
  case 1:
3028
2887
  case "end":
3029
- return _context56.stop();
2888
+ return _context54.stop();
3030
2889
  }
3031
- }, _callee56);
2890
+ }, _callee54);
3032
2891
  }));
3033
2892
  return function (_x6) {
3034
- return _ref57.apply(this, arguments);
2893
+ return _ref55.apply(this, arguments);
3035
2894
  };
3036
2895
  }());
3037
- _context57.next = 1;
2896
+ _context55.next = 1;
3038
2897
  return call.doHoldResume();
3039
2898
  case 1:
3040
- _context57.next = 2;
2899
+ _context55.next = 2;
3041
2900
  return (0, _testUtil.flushPromises)(2);
3042
2901
  case 2:
3043
2902
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -3053,11 +2912,11 @@ describe('Supplementary Services tests', function () {
3053
2912
  call['handleIncomingRoapOffer']({}, dummyEvent);
3054
2913
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3055
2914
  roapEvent.data.type = 'ANSWER';
3056
- _context57.next = 3;
2915
+ _context55.next = 3;
3057
2916
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3058
2917
  case 3:
3059
2918
  roapEvent.data.type = 'OK';
3060
- _context57.next = 4;
2919
+ _context55.next = 4;
3061
2920
  return call['handleRoapEstablished']({}, dummyEvent);
3062
2921
  case 4:
3063
2922
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -3072,14 +2931,14 @@ describe('Supplementary Services tests', function () {
3072
2931
  });
3073
2932
  case 5:
3074
2933
  case "end":
3075
- return _context57.stop();
2934
+ return _context55.stop();
3076
2935
  }
3077
- }, _callee57);
2936
+ }, _callee55);
3078
2937
  })));
3079
- it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
2938
+ it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee57() {
3080
2939
  var responsePayload, warnSpy, roapEvent;
3081
- return _regenerator.default.wrap(function (_context59) {
3082
- while (1) switch (_context59.prev = _context59.next) {
2940
+ return _regenerator.default.wrap(function (_context57) {
2941
+ while (1) switch (_context57.prev = _context57.next) {
3083
2942
  case 0:
3084
2943
  expect.assertions(7);
3085
2944
  responsePayload = {
@@ -3092,26 +2951,26 @@ describe('Supplementary Services tests', function () {
3092
2951
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3093
2952
  call['held'] = true;
3094
2953
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
3095
- var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(correlationId) {
3096
- return _regenerator.default.wrap(function (_context58) {
3097
- while (1) switch (_context58.prev = _context58.next) {
2954
+ var _ref57 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
2955
+ return _regenerator.default.wrap(function (_context56) {
2956
+ while (1) switch (_context56.prev = _context56.next) {
3098
2957
  case 0:
3099
2958
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3100
2959
  case 1:
3101
2960
  case "end":
3102
- return _context58.stop();
2961
+ return _context56.stop();
3103
2962
  }
3104
- }, _callee58);
2963
+ }, _callee56);
3105
2964
  }));
3106
2965
  return function (_x7) {
3107
- return _ref59.apply(this, arguments);
2966
+ return _ref57.apply(this, arguments);
3108
2967
  };
3109
2968
  }());
3110
2969
  call.doHoldResume();
3111
- _context59.next = 1;
2970
+ _context57.next = 1;
3112
2971
  return _promise.default.resolve();
3113
2972
  case 1:
3114
- _context59.next = 2;
2973
+ _context57.next = 2;
3115
2974
  return _promise.default.resolve();
3116
2975
  case 2:
3117
2976
  expect(setTimeout).not.toHaveBeenCalled();
@@ -3127,11 +2986,11 @@ describe('Supplementary Services tests', function () {
3127
2986
  call['handleIncomingRoapOffer']({}, dummyEvent);
3128
2987
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3129
2988
  roapEvent.data.type = 'ANSWER';
3130
- _context59.next = 3;
2989
+ _context57.next = 3;
3131
2990
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3132
2991
  case 3:
3133
2992
  roapEvent.data.type = 'OK';
3134
- _context59.next = 4;
2993
+ _context57.next = 4;
3135
2994
  return call['handleRoapEstablished']({}, dummyEvent);
3136
2995
  case 4:
3137
2996
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -3146,14 +3005,14 @@ describe('Supplementary Services tests', function () {
3146
3005
  });
3147
3006
  case 5:
3148
3007
  case "end":
3149
- return _context59.stop();
3008
+ return _context57.stop();
3150
3009
  }
3151
- }, _callee59);
3010
+ }, _callee57);
3152
3011
  })));
3153
- it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
3012
+ it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee59() {
3154
3013
  var responsePayload;
3155
- return _regenerator.default.wrap(function (_context61) {
3156
- while (1) switch (_context61.prev = _context61.next) {
3014
+ return _regenerator.default.wrap(function (_context59) {
3015
+ while (1) switch (_context59.prev = _context59.next) {
3157
3016
  case 0:
3158
3017
  expect.assertions(4);
3159
3018
  responsePayload = {
@@ -3163,26 +3022,26 @@ describe('Supplementary Services tests', function () {
3163
3022
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3164
3023
  call['held'] = true;
3165
3024
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3166
- var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(errObj) {
3167
- return _regenerator.default.wrap(function (_context60) {
3168
- while (1) switch (_context60.prev = _context60.next) {
3025
+ var _ref59 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee58(errObj) {
3026
+ return _regenerator.default.wrap(function (_context58) {
3027
+ while (1) switch (_context58.prev = _context58.next) {
3169
3028
  case 0:
3170
3029
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3171
3030
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3172
3031
  case 1:
3173
3032
  case "end":
3174
- return _context60.stop();
3033
+ return _context58.stop();
3175
3034
  }
3176
- }, _callee60);
3035
+ }, _callee58);
3177
3036
  }));
3178
3037
  return function (_x8) {
3179
- return _ref61.apply(this, arguments);
3038
+ return _ref59.apply(this, arguments);
3180
3039
  };
3181
3040
  }());
3182
- _context61.next = 1;
3041
+ _context59.next = 1;
3183
3042
  return call.doHoldResume();
3184
3043
  case 1:
3185
- _context61.next = 2;
3044
+ _context59.next = 2;
3186
3045
  return (0, _testUtil.flushPromises)(2);
3187
3046
  case 2:
3188
3047
  expect(call.isHeld()).toStrictEqual(true);
@@ -3193,14 +3052,14 @@ describe('Supplementary Services tests', function () {
3193
3052
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3194
3053
  case 3:
3195
3054
  case "end":
3196
- return _context61.stop();
3055
+ return _context59.stop();
3197
3056
  }
3198
- }, _callee61);
3057
+ }, _callee59);
3199
3058
  })));
3200
- it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
3059
+ it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee61() {
3201
3060
  var responsePayload, rejectPayload, roapEvent;
3202
- return _regenerator.default.wrap(function (_context63) {
3203
- while (1) switch (_context63.prev = _context63.next) {
3061
+ return _regenerator.default.wrap(function (_context61) {
3062
+ while (1) switch (_context61.prev = _context61.next) {
3204
3063
  case 0:
3205
3064
  expect.assertions(5);
3206
3065
  responsePayload = {
@@ -3214,24 +3073,24 @@ describe('Supplementary Services tests', function () {
3214
3073
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
3215
3074
  call['held'] = true;
3216
3075
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3217
- var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
3218
- return _regenerator.default.wrap(function (_context62) {
3219
- while (1) switch (_context62.prev = _context62.next) {
3076
+ var _ref61 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee60(errObj) {
3077
+ return _regenerator.default.wrap(function (_context60) {
3078
+ while (1) switch (_context60.prev = _context60.next) {
3220
3079
  case 0:
3221
3080
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
3222
3081
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
3223
3082
  case 1:
3224
3083
  case "end":
3225
- return _context62.stop();
3084
+ return _context60.stop();
3226
3085
  }
3227
- }, _callee62);
3086
+ }, _callee60);
3228
3087
  }));
3229
3088
  return function (_x9) {
3230
- return _ref63.apply(this, arguments);
3089
+ return _ref61.apply(this, arguments);
3231
3090
  };
3232
3091
  }());
3233
3092
  call.doHoldResume();
3234
- _context63.next = 1;
3093
+ _context61.next = 1;
3235
3094
  return (0, _testUtil.flushPromises)(2);
3236
3095
  case 1:
3237
3096
  /* At this point , the Call State should transition to S_CALL_ESTABLISHED
@@ -3242,7 +3101,7 @@ describe('Supplementary Services tests', function () {
3242
3101
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3243
3102
  /* We are intentionally failing the ROAP ANSWER */
3244
3103
  roapEvent.data.type = 'ANSWER';
3245
- _context63.next = 2;
3104
+ _context61.next = 2;
3246
3105
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3247
3106
  case 2:
3248
3107
  expect(call.isHeld()).toStrictEqual(true);
@@ -3250,14 +3109,14 @@ describe('Supplementary Services tests', function () {
3250
3109
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3251
3110
  case 3:
3252
3111
  case "end":
3253
- return _context63.stop();
3112
+ return _context61.stop();
3254
3113
  }
3255
- }, _callee63);
3114
+ }, _callee61);
3256
3115
  })));
3257
- it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65() {
3116
+ it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee63() {
3258
3117
  var responsePayload, roapEvent;
3259
- return _regenerator.default.wrap(function (_context65) {
3260
- while (1) switch (_context65.prev = _context65.next) {
3118
+ return _regenerator.default.wrap(function (_context63) {
3119
+ while (1) switch (_context63.prev = _context63.next) {
3261
3120
  case 0:
3262
3121
  expect.assertions(5);
3263
3122
  responsePayload = {
@@ -3267,24 +3126,24 @@ describe('Supplementary Services tests', function () {
3267
3126
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
3268
3127
  call['held'] = true;
3269
3128
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
3270
- var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(errObj) {
3271
- return _regenerator.default.wrap(function (_context64) {
3272
- while (1) switch (_context64.prev = _context64.next) {
3129
+ var _ref63 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee62(errObj) {
3130
+ return _regenerator.default.wrap(function (_context62) {
3131
+ while (1) switch (_context62.prev = _context62.next) {
3273
3132
  case 0:
3274
3133
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
3275
3134
  expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
3276
3135
  case 1:
3277
3136
  case "end":
3278
- return _context64.stop();
3137
+ return _context62.stop();
3279
3138
  }
3280
- }, _callee64);
3139
+ }, _callee62);
3281
3140
  }));
3282
3141
  return function (_x0) {
3283
- return _ref65.apply(this, arguments);
3142
+ return _ref63.apply(this, arguments);
3284
3143
  };
3285
3144
  }());
3286
3145
  call.doHoldResume();
3287
- _context65.next = 1;
3146
+ _context63.next = 1;
3288
3147
  return (0, _testUtil.flushPromises)(2);
3289
3148
  case 1:
3290
3149
  /* At this point ,the Call State should be S_CALL_RESUME
@@ -3297,11 +3156,11 @@ describe('Supplementary Services tests', function () {
3297
3156
  call['handleIncomingRoapOffer']({}, dummyEvent);
3298
3157
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
3299
3158
  roapEvent.data.type = 'ANSWER';
3300
- _context65.next = 2;
3159
+ _context63.next = 2;
3301
3160
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
3302
3161
  case 2:
3303
3162
  roapEvent.data.type = 'OK';
3304
- _context65.next = 3;
3163
+ _context63.next = 3;
3305
3164
  return call['handleRoapEstablished']({}, dummyEvent);
3306
3165
  case 3:
3307
3166
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -3311,9 +3170,9 @@ describe('Supplementary Services tests', function () {
3311
3170
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
3312
3171
  case 4:
3313
3172
  case "end":
3314
- return _context65.stop();
3173
+ return _context63.stop();
3315
3174
  }
3316
- }, _callee65);
3175
+ }, _callee63);
3317
3176
  })));
3318
3177
  });
3319
3178
  describe('Call transfer tests', function () {
@@ -3346,10 +3205,10 @@ describe('Supplementary Services tests', function () {
3346
3205
  secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
3347
3206
  secondCall['held'] = false;
3348
3207
  });
3349
- it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
3208
+ it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66() {
3350
3209
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3351
- return _regenerator.default.wrap(function (_context68) {
3352
- while (1) switch (_context68.prev = _context68.next) {
3210
+ return _regenerator.default.wrap(function (_context66) {
3211
+ while (1) switch (_context66.prev = _context66.next) {
3353
3212
  case 0:
3354
3213
  expect.assertions(12); // Updated to match actual assertion count
3355
3214
  responsePayload = {
@@ -3361,41 +3220,41 @@ describe('Supplementary Services tests', function () {
3361
3220
  infoSpy = jest.spyOn(_Logger.default, 'info');
3362
3221
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3363
3222
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3364
- var _ref67 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee66(correlationId) {
3365
- return _regenerator.default.wrap(function (_context66) {
3366
- while (1) switch (_context66.prev = _context66.next) {
3223
+ var _ref65 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee64(correlationId) {
3224
+ return _regenerator.default.wrap(function (_context64) {
3225
+ while (1) switch (_context64.prev = _context64.next) {
3367
3226
  case 0:
3368
3227
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3369
3228
  case 1:
3370
3229
  case "end":
3371
- return _context66.stop();
3230
+ return _context64.stop();
3372
3231
  }
3373
- }, _callee66);
3232
+ }, _callee64);
3374
3233
  }));
3375
3234
  return function (_x1) {
3376
- return _ref67.apply(this, arguments);
3235
+ return _ref65.apply(this, arguments);
3377
3236
  };
3378
3237
  }());
3379
3238
  secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3380
- var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
3381
- return _regenerator.default.wrap(function (_context67) {
3382
- while (1) switch (_context67.prev = _context67.next) {
3239
+ var _ref66 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee65(correlationId) {
3240
+ return _regenerator.default.wrap(function (_context65) {
3241
+ while (1) switch (_context65.prev = _context65.next) {
3383
3242
  case 0:
3384
3243
  expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
3385
3244
  case 1:
3386
3245
  case "end":
3387
- return _context67.stop();
3246
+ return _context65.stop();
3388
3247
  }
3389
- }, _callee67);
3248
+ }, _callee65);
3390
3249
  }));
3391
3250
  return function (_x10) {
3392
- return _ref68.apply(this, arguments);
3251
+ return _ref66.apply(this, arguments);
3393
3252
  };
3394
3253
  }());
3395
- _context68.next = 1;
3254
+ _context66.next = 1;
3396
3255
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3397
3256
  case 1:
3398
- _context68.next = 2;
3257
+ _context66.next = 2;
3399
3258
  return (0, _testUtil.flushPromises)(2);
3400
3259
  case 2:
3401
3260
  expect(requestSpy).toBeCalled();
@@ -3418,14 +3277,14 @@ describe('Supplementary Services tests', function () {
3418
3277
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3419
3278
  case 3:
3420
3279
  case "end":
3421
- return _context68.stop();
3280
+ return _context66.stop();
3422
3281
  }
3423
- }, _callee68);
3282
+ }, _callee66);
3424
3283
  })));
3425
- it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
3284
+ it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee68() {
3426
3285
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3427
- return _regenerator.default.wrap(function (_context70) {
3428
- while (1) switch (_context70.prev = _context70.next) {
3286
+ return _regenerator.default.wrap(function (_context68) {
3287
+ while (1) switch (_context68.prev = _context68.next) {
3429
3288
  case 0:
3430
3289
  expect.assertions(10); // Updated to match actual assertion count
3431
3290
  responsePayload = {
@@ -3437,25 +3296,25 @@ describe('Supplementary Services tests', function () {
3437
3296
  infoSpy = jest.spyOn(_Logger.default, 'info');
3438
3297
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3439
3298
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3440
- var _ref70 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69(correlationId) {
3441
- return _regenerator.default.wrap(function (_context69) {
3442
- while (1) switch (_context69.prev = _context69.next) {
3299
+ var _ref68 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee67(correlationId) {
3300
+ return _regenerator.default.wrap(function (_context67) {
3301
+ while (1) switch (_context67.prev = _context67.next) {
3443
3302
  case 0:
3444
3303
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3445
3304
  case 1:
3446
3305
  case "end":
3447
- return _context69.stop();
3306
+ return _context67.stop();
3448
3307
  }
3449
- }, _callee69);
3308
+ }, _callee67);
3450
3309
  }));
3451
3310
  return function (_x11) {
3452
- return _ref70.apply(this, arguments);
3311
+ return _ref68.apply(this, arguments);
3453
3312
  };
3454
3313
  }());
3455
- _context70.next = 1;
3314
+ _context68.next = 1;
3456
3315
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3457
3316
  case 1:
3458
- _context70.next = 2;
3317
+ _context68.next = 2;
3459
3318
  return (0, _testUtil.flushPromises)(2);
3460
3319
  case 2:
3461
3320
  expect(requestSpy).toBeCalled();
@@ -3474,14 +3333,14 @@ describe('Supplementary Services tests', function () {
3474
3333
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3475
3334
  case 3:
3476
3335
  case "end":
3477
- return _context70.stop();
3336
+ return _context68.stop();
3478
3337
  }
3479
- }, _callee70);
3338
+ }, _callee68);
3480
3339
  })));
3481
- it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
3340
+ it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee69() {
3482
3341
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3483
- return _regenerator.default.wrap(function (_context71) {
3484
- while (1) switch (_context71.prev = _context71.next) {
3342
+ return _regenerator.default.wrap(function (_context69) {
3343
+ while (1) switch (_context69.prev = _context69.next) {
3485
3344
  case 0:
3486
3345
  responsePayload = {
3487
3346
  statusCode: 403,
@@ -3492,10 +3351,10 @@ describe('Supplementary Services tests', function () {
3492
3351
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3493
3352
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3494
3353
  call['broadworksCorrelationInfo'] = 'dummy-broadworks-correlation-info';
3495
- _context71.next = 1;
3354
+ _context69.next = 1;
3496
3355
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3497
3356
  case 1:
3498
- _context71.next = 2;
3357
+ _context69.next = 2;
3499
3358
  return (0, _testUtil.flushPromises)(1);
3500
3359
  case 2:
3501
3360
  expect(requestSpy).toBeCalled();
@@ -3516,14 +3375,14 @@ describe('Supplementary Services tests', function () {
3516
3375
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3517
3376
  case 3:
3518
3377
  case "end":
3519
- return _context71.stop();
3378
+ return _context69.stop();
3520
3379
  }
3521
- }, _callee71);
3380
+ }, _callee69);
3522
3381
  })));
3523
- it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3382
+ it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee70() {
3524
3383
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3525
- return _regenerator.default.wrap(function (_context72) {
3526
- while (1) switch (_context72.prev = _context72.next) {
3384
+ return _regenerator.default.wrap(function (_context70) {
3385
+ while (1) switch (_context70.prev = _context70.next) {
3527
3386
  case 0:
3528
3387
  responsePayload = {
3529
3388
  statusCode: 403,
@@ -3533,10 +3392,10 @@ describe('Supplementary Services tests', function () {
3533
3392
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3534
3393
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3535
3394
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3536
- _context72.next = 1;
3395
+ _context70.next = 1;
3537
3396
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3538
3397
  case 1:
3539
- _context72.next = 2;
3398
+ _context70.next = 2;
3540
3399
  return (0, _testUtil.flushPromises)(2);
3541
3400
  case 2:
3542
3401
  expect(requestSpy).toBeCalled();
@@ -3557,18 +3416,18 @@ describe('Supplementary Services tests', function () {
3557
3416
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3558
3417
  case 3:
3559
3418
  case "end":
3560
- return _context72.stop();
3419
+ return _context70.stop();
3561
3420
  }
3562
- }, _callee72);
3421
+ }, _callee70);
3563
3422
  })));
3564
- it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee73() {
3423
+ it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee71() {
3565
3424
  var requestSpy, warnSpy;
3566
- return _regenerator.default.wrap(function (_context73) {
3567
- while (1) switch (_context73.prev = _context73.next) {
3425
+ return _regenerator.default.wrap(function (_context71) {
3426
+ while (1) switch (_context71.prev = _context71.next) {
3568
3427
  case 0:
3569
3428
  requestSpy = jest.spyOn(webex, 'request');
3570
3429
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3571
- _context73.next = 1;
3430
+ _context71.next = 1;
3572
3431
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
3573
3432
  case 1:
3574
3433
  /* We should be in CALL_ESTABLISHED state */
@@ -3580,18 +3439,18 @@ describe('Supplementary Services tests', function () {
3580
3439
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3581
3440
  case 2:
3582
3441
  case "end":
3583
- return _context73.stop();
3442
+ return _context71.stop();
3584
3443
  }
3585
- }, _callee73);
3444
+ }, _callee71);
3586
3445
  })));
3587
- it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee74() {
3446
+ it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee72() {
3588
3447
  var requestSpy, warnSpy;
3589
- return _regenerator.default.wrap(function (_context74) {
3590
- while (1) switch (_context74.prev = _context74.next) {
3448
+ return _regenerator.default.wrap(function (_context72) {
3449
+ while (1) switch (_context72.prev = _context72.next) {
3591
3450
  case 0:
3592
3451
  requestSpy = jest.spyOn(webex, 'request');
3593
3452
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3594
- _context74.next = 1;
3453
+ _context72.next = 1;
3595
3454
  return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
3596
3455
  case 1:
3597
3456
  /* We should be in CALL_ESTABLISHED state */
@@ -3603,9 +3462,9 @@ describe('Supplementary Services tests', function () {
3603
3462
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3604
3463
  case 2:
3605
3464
  case "end":
3606
- return _context74.stop();
3465
+ return _context72.stop();
3607
3466
  }
3608
- }, _callee74);
3467
+ }, _callee72);
3609
3468
  })));
3610
3469
  });
3611
3470
  });