@webex/calling 3.7.0-next.8 → 3.7.0-wxcc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/CallHistory/CallHistory.js +67 -195
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +108 -331
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js +1 -25
  6. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  7. package/dist/CallHistory/constants.js +1 -4
  8. package/dist/CallHistory/constants.js.map +1 -1
  9. package/dist/CallHistory/types.js.map +1 -1
  10. package/dist/CallingClient/CallingClient.js +2 -2
  11. package/dist/CallingClient/CallingClient.js.map +1 -1
  12. package/dist/CallingClient/CallingClient.test.js +2 -2
  13. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  14. package/dist/CallingClient/calling/CallerId/index.js +5 -14
  15. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  16. package/dist/CallingClient/calling/CallerId/index.test.js +6 -6
  17. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  18. package/dist/CallingClient/calling/call.js +348 -434
  19. package/dist/CallingClient/calling/call.js.map +1 -1
  20. package/dist/CallingClient/calling/call.test.js +386 -516
  21. package/dist/CallingClient/calling/call.test.js.map +1 -1
  22. package/dist/CallingClient/calling/callManager.js +6 -6
  23. package/dist/CallingClient/calling/callManager.js.map +1 -1
  24. package/dist/CallingClient/calling/callManager.test.js +3 -3
  25. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  26. package/dist/CallingClient/calling/types.js +1 -6
  27. package/dist/CallingClient/calling/types.js.map +1 -1
  28. package/dist/CallingClient/constants.js +3 -2
  29. package/dist/CallingClient/constants.js.map +1 -1
  30. package/dist/CallingClient/line/index.js +7 -14
  31. package/dist/CallingClient/line/index.js.map +1 -1
  32. package/dist/CallingClient/line/line.test.js +22 -84
  33. package/dist/CallingClient/line/line.test.js.map +1 -1
  34. package/dist/CallingClient/line/types.js.map +1 -1
  35. package/dist/CallingClient/registration/register.js +59 -79
  36. package/dist/CallingClient/registration/register.js.map +1 -1
  37. package/dist/CallingClient/registration/register.test.js +1 -1
  38. package/dist/CallingClient/registration/register.test.js.map +1 -1
  39. package/dist/CallingClient/types.js.map +1 -1
  40. package/dist/Contacts/ContactsClient.js +14 -14
  41. package/dist/Contacts/ContactsClient.js.map +1 -1
  42. package/dist/Events/types.js +0 -2
  43. package/dist/Events/types.js.map +1 -1
  44. package/dist/common/Utils.js +13 -18
  45. package/dist/common/Utils.js.map +1 -1
  46. package/dist/common/Utils.test.js +0 -97
  47. package/dist/common/Utils.test.js.map +1 -1
  48. package/dist/common/constants.js +3 -4
  49. package/dist/common/constants.js.map +1 -1
  50. package/dist/common/types.js +0 -1
  51. package/dist/common/types.js.map +1 -1
  52. package/dist/index.js +12 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/module/CallHistory/CallHistory.js +2 -64
  55. package/dist/module/CallHistory/callHistoryFixtures.js +0 -24
  56. package/dist/module/CallHistory/constants.js +0 -3
  57. package/dist/module/CallingClient/CallingClient.js +1 -1
  58. package/dist/module/CallingClient/calling/CallerId/index.js +6 -6
  59. package/dist/module/CallingClient/calling/call.js +22 -66
  60. package/dist/module/CallingClient/calling/callManager.js +5 -5
  61. package/dist/module/CallingClient/calling/types.js +0 -5
  62. package/dist/module/CallingClient/constants.js +2 -1
  63. package/dist/module/CallingClient/line/index.js +8 -14
  64. package/dist/module/CallingClient/registration/register.js +4 -12
  65. package/dist/module/Contacts/ContactsClient.js +2 -2
  66. package/dist/module/Events/types.js +0 -2
  67. package/dist/module/common/Utils.js +5 -12
  68. package/dist/module/common/constants.js +2 -3
  69. package/dist/module/common/types.js +0 -1
  70. package/dist/module/index.js +1 -0
  71. package/dist/types/CallHistory/CallHistory.d.ts +2 -4
  72. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  73. package/dist/types/CallHistory/callHistoryFixtures.d.ts +2 -6
  74. package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
  75. package/dist/types/CallHistory/constants.d.ts +0 -3
  76. package/dist/types/CallHistory/constants.d.ts.map +1 -1
  77. package/dist/types/CallHistory/types.d.ts +0 -9
  78. package/dist/types/CallHistory/types.d.ts.map +1 -1
  79. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  80. package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
  81. package/dist/types/CallingClient/calling/call.d.ts +5 -7
  82. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  83. package/dist/types/CallingClient/calling/callManager.d.ts +1 -1
  84. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  85. package/dist/types/CallingClient/calling/types.d.ts +2 -6
  86. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  87. package/dist/types/CallingClient/constants.d.ts +2 -1
  88. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  89. package/dist/types/CallingClient/line/index.d.ts +2 -3
  90. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  91. package/dist/types/CallingClient/line/types.d.ts +1 -1
  92. package/dist/types/CallingClient/line/types.d.ts.map +1 -1
  93. package/dist/types/CallingClient/registration/register.d.ts +2 -4
  94. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  95. package/dist/types/CallingClient/types.d.ts +0 -1
  96. package/dist/types/CallingClient/types.d.ts.map +1 -1
  97. package/dist/types/Contacts/ContactsClient.d.ts +1 -1
  98. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  99. package/dist/types/Events/types.d.ts +2 -15
  100. package/dist/types/Events/types.d.ts.map +1 -1
  101. package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
  102. package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
  103. package/dist/types/common/Utils.d.ts +2 -2
  104. package/dist/types/common/Utils.d.ts.map +1 -1
  105. package/dist/types/common/constants.d.ts +0 -1
  106. package/dist/types/common/constants.d.ts.map +1 -1
  107. package/dist/types/common/types.d.ts +1 -2
  108. package/dist/types/common/types.d.ts.map +1 -1
  109. package/dist/types/index.d.ts +2 -0
  110. package/dist/types/index.d.ts.map +1 -1
  111. package/package.json +3 -3
@@ -130,7 +130,7 @@ describe('Call Tests', function () {
130
130
  }
131
131
  }
132
132
  });
133
- var call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
133
+ var call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
134
134
  expect(call).toBeTruthy();
135
135
  });
136
136
  it('should log a warning when sending a digit fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
@@ -146,7 +146,7 @@ describe('Call Tests', function () {
146
146
  })
147
147
  };
148
148
  callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
149
- call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
149
+ call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
150
150
  realMediaConnection = call.mediaConnection; // Set the mock mediaConnection object
151
151
  call.mediaConnection = mockMediaConnection;
152
152
 
@@ -197,7 +197,7 @@ describe('Call Tests', function () {
197
197
  setUserMuted: jest.fn()
198
198
  };
199
199
  localAudioStream = mockStream;
200
- call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
200
+ call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
201
201
  expect(call).toBeTruthy();
202
202
  /* After creation , call manager should have 1 record */
203
203
  expect((0, _keys.default)(callManager.getActiveCalls()).length).toBe(1);
@@ -250,7 +250,7 @@ describe('Call Tests', function () {
250
250
  callId: '8a67806f-fc4d-446b-a131-31e71ea5b020'
251
251
  }
252
252
  };
253
- call = callManager.createCall(_types3.CallDirection.INBOUND, deviceId, mockLineId, dest);
253
+ call = callManager.createCall(dest, _types3.CallDirection.INBOUND, deviceId, mockLineId);
254
254
  _context3.next = 5;
255
255
  return call['postMedia']({});
256
256
  case 5:
@@ -267,7 +267,7 @@ describe('Call Tests', function () {
267
267
  return _regenerator.default.wrap(function _callee4$(_context4) {
268
268
  while (1) switch (_context4.prev = _context4.next) {
269
269
  case 0:
270
- call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
270
+ call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
271
271
  call.handleMidCallEvent(dummyMidCallEvent);
272
272
  _context4.next = 4;
273
273
  return (0, _Utils.waitForMsecs)(50);
@@ -286,7 +286,7 @@ describe('Call Tests', function () {
286
286
  return _regenerator.default.wrap(function _callee5$(_context5) {
287
287
  while (1) switch (_context5.prev = _context5.next) {
288
288
  case 0:
289
- call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
289
+ call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
290
290
  dummyMidCallEvent.eventType = 'callState';
291
291
  logSpy = jest.spyOn(_Logger.default, 'log');
292
292
  call.handleMidCallEvent(dummyMidCallEvent);
@@ -309,7 +309,7 @@ describe('Call Tests', function () {
309
309
  return _regenerator.default.wrap(function _callee6$(_context6) {
310
310
  while (1) switch (_context6.prev = _context6.next) {
311
311
  case 0:
312
- call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
312
+ call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
313
313
  _context6.prev = 1;
314
314
  _context6.next = 4;
315
315
  return call.getCallRtpStats();
@@ -345,11 +345,11 @@ describe('Call Tests', function () {
345
345
  };
346
346
  localAudioStream = mockStream;
347
347
  warnSpy = jest.spyOn(_Logger.default, 'warn');
348
- call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
348
+ call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
349
349
  bnrMetricSpy = jest.spyOn(call['metricManager'], 'submitBNRMetric');
350
350
  call.dial(localAudioStream);
351
351
  expect(mockTrack.enabled).toEqual(true);
352
- expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
352
+ expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
353
353
  expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
354
354
  expect(bnrMetricSpy).toBeCalledOnceWith(_types4.METRIC_EVENT.BNR_ENABLED, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId());
355
355
 
@@ -383,12 +383,12 @@ describe('Call Tests', function () {
383
383
  };
384
384
  localAudioStream = mockStream;
385
385
  warnSpy = jest.spyOn(_Logger.default, 'warn');
386
- call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
386
+ call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
387
387
  /** Cannot answer in idle state */
388
388
  bnrMetricSpy = jest.spyOn(call['metricManager'], 'submitBNRMetric');
389
389
  call.answer(localAudioStream);
390
390
  expect(mockTrack.enabled).toEqual(true);
391
- expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
391
+ expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
392
392
  expect(call['callStateMachine'].state.value).toBe('S_IDLE');
393
393
  expect(warnSpy).toBeCalledOnceWith("Call cannot be answered because the state is : S_IDLE", {
394
394
  file: 'call',
@@ -424,10 +424,10 @@ describe('Call Tests', function () {
424
424
  onEffectSpy = jest.spyOn(mockEffect, 'on');
425
425
  offStreamSpy = jest.spyOn(localAudioStream, 'off');
426
426
  offEffectSpy = jest.spyOn(mockEffect, 'off');
427
- call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
427
+ call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
428
428
  call.dial(localAudioStream);
429
429
  expect(mockTrack.enabled).toEqual(true);
430
- expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String), expect.any(Function), expect.any(Function), expect.any(Function));
430
+ expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
431
431
  expect(call['mediaStateMachine'].state.value).toBe('S_SEND_ROAP_OFFER');
432
432
  updateLocalTracksSpy = jest.spyOn(call['mediaConnection'], 'updateLocalTracks');
433
433
  bnrMetricSpy = jest.spyOn(call['metricManager'], 'submitBNRMetric');
@@ -505,7 +505,7 @@ describe('Call Tests', function () {
505
505
  }
506
506
  });
507
507
  warnSpy = jest.spyOn(_Logger.default, 'warn');
508
- call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
508
+ call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
509
509
  call.answer(localAudioStream);
510
510
  _context10.next = 8;
511
511
  return (0, _Utils.waitForMsecs)(50);
@@ -539,7 +539,7 @@ describe('Call Tests', function () {
539
539
  };
540
540
  localAudioStream = mockStream;
541
541
  warnSpy = jest.spyOn(_Logger.default, 'warn');
542
- call = (0, _call.createCall)(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator, dest);
542
+ call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
543
543
  call.dial(localAudioStream);
544
544
  _context11.next = 7;
545
545
  return (0, _Utils.waitForMsecs)(50);
@@ -571,7 +571,7 @@ describe('Call Tests', function () {
571
571
  var localAudioStream = mockStream;
572
572
  var onStream1Spy = jest.spyOn(localAudioStream, 'on');
573
573
  var offStream1Spy = jest.spyOn(localAudioStream, 'off');
574
- var call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
574
+ var call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
575
575
  call.dial(localAudioStream);
576
576
  expect(mockTrack.enabled).toEqual(true);
577
577
  expect(onStream1Spy).toBeCalledTimes(2);
@@ -609,7 +609,7 @@ describe('Call Tests', function () {
609
609
  getEffectByKind: jest.fn()
610
610
  };
611
611
  var localAudioStream = mockStream;
612
- var call = callManager.createCall(_types3.CallDirection.OUTBOUND, deviceId, mockLineId, dest);
612
+ var call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
613
613
  call.dial(localAudioStream);
614
614
  expect(mockTrack.enabled).toEqual(true);
615
615
  var errorStream = {
@@ -625,136 +625,6 @@ describe('Call Tests', function () {
625
625
  method: 'updateMedia'
626
626
  });
627
627
  });
628
- it('test system mute and user mute different scnearios', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
629
- var logSpy, callManager, mockStream, localAudioStream, call;
630
- return _regenerator.default.wrap(function _callee12$(_context12) {
631
- while (1) switch (_context12.prev = _context12.next) {
632
- case 0:
633
- logSpy = jest.spyOn(_Logger.default, 'info');
634
- webex.request.mockReturnValue({
635
- statusCode: 200,
636
- body: {
637
- device: {
638
- deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
639
- correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
640
- },
641
- callId: '8a67806f-fc4d-446b-a131-31e71ea5b020'
642
- }
643
- });
644
- callManager = (0, _callManager.getCallManager)(webex, defaultServiceIndicator);
645
- mockStream = {
646
- on: jest.fn(),
647
- setUserMuted: jest.fn(),
648
- systemMuted: false,
649
- userMuted: false
650
- };
651
- localAudioStream = mockStream;
652
- call = callManager.createCall(dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId);
653
- expect(call).toBeTruthy();
654
- /* System mute is being triggered, mute state within call object should update to true */
655
- mockStream.systemMuted = true;
656
- call.mute(localAudioStream, _types5.MUTE_TYPE.SYSTEM);
657
- expect(call.isMuted()).toEqual(true);
658
-
659
- /* User mute is triggered, but no change will happen to the call object mute state since it is system muted */
660
- logSpy.mockClear();
661
- call.mute(localAudioStream, _types5.MUTE_TYPE.USER);
662
- expect(call.isMuted()).toEqual(true);
663
- expect(mockStream.setUserMuted).not.toBeCalledOnceWith(true);
664
- expect(logSpy).toBeCalledOnceWith("Call is muted on the system - ".concat(call.getCorrelationId(), "."), {
665
- file: 'call',
666
- method: 'mute'
667
- });
668
-
669
- /* System mute is being triggered, mute state within call object should update to false */
670
- mockStream.systemMuted = false;
671
- call.mute(localAudioStream, _types5.MUTE_TYPE.SYSTEM);
672
- expect(call.isMuted()).toEqual(false);
673
-
674
- /* User mute can be triggered now updating call object mute state as well */
675
- call.mute(localAudioStream, _types5.MUTE_TYPE.USER);
676
- expect(call.isMuted()).toEqual(true);
677
- expect(mockStream.setUserMuted).toBeCalledOnceWith(true);
678
- mockStream.userMuted = true;
679
-
680
- /* System mute being triggered now won't update the mute state within call object but will block the user unmute */
681
- logSpy.mockClear();
682
- mockStream.systemMuted = true;
683
- call.mute(localAudioStream, _types5.MUTE_TYPE.SYSTEM);
684
- expect(call.isMuted()).toEqual(true);
685
- expect(logSpy).toBeCalledOnceWith("Call is muted by the user already - ".concat(call.getCorrelationId(), "."), {
686
- file: 'call',
687
- method: 'mute'
688
- });
689
-
690
- /* User mute now won't be able to update mute state back to false as system mute is also set */
691
- call.mute(localAudioStream, _types5.MUTE_TYPE.USER);
692
- expect(call.isMuted()).toEqual(true);
693
- expect(mockStream.setUserMuted).not.toBeCalledOnceWith(false);
694
-
695
- /* Revert the system mute but call mute state remains same */
696
- mockStream.systemMuted = false;
697
- call.mute(localAudioStream, _types5.MUTE_TYPE.SYSTEM);
698
- expect(call.isMuted()).toEqual(true);
699
-
700
- /* User mute will be able update the mute state now */
701
- mockStream.setUserMuted.mockClear();
702
- call.mute(localAudioStream, _types5.MUTE_TYPE.USER);
703
- expect(call.isMuted()).toEqual(false);
704
- expect(mockStream.setUserMuted).toBeCalledOnceWith(false);
705
- case 37:
706
- case "end":
707
- return _context12.stop();
708
- }
709
- }, _callee12);
710
- })));
711
- describe('Guest Calling Flow Tests', function () {
712
- var dummyEvent = {
713
- type: 'E_SEND_CALL_SETUP',
714
- data: undefined
715
- };
716
- var call;
717
- it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
718
- var requestSpy, requestArgs;
719
- return _regenerator.default.wrap(function _callee13$(_context13) {
720
- while (1) switch (_context13.prev = _context13.next) {
721
- case 0:
722
- call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
723
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
724
- var dummy = 10;
725
- }, defaultServiceIndicator, dest);
726
- call['callStateMachine'].state.value = 'S_IDLE';
727
- requestSpy = jest.spyOn(webex, 'request');
728
- call.sendCallStateMachineEvt(dummyEvent);
729
- requestArgs = requestSpy.mock.calls[0][0];
730
- expect('callee' in requestArgs.body).toBe(true);
731
- case 6:
732
- case "end":
733
- return _context13.stop();
734
- }
735
- }, _callee13);
736
- })));
737
- it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
738
- var requestSpy, requestArgs;
739
- return _regenerator.default.wrap(function _callee14$(_context14) {
740
- while (1) switch (_context14.prev = _context14.next) {
741
- case 0:
742
- call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
743
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
744
- var dummy = 10;
745
- }, defaultServiceIndicator);
746
- call['callStateMachine'].state.value = 'S_IDLE';
747
- requestSpy = jest.spyOn(webex, 'request');
748
- call.sendCallStateMachineEvt(dummyEvent);
749
- requestArgs = requestSpy.mock.calls[0][0];
750
- expect('callee' in requestArgs.body).toBe(false);
751
- case 6:
752
- case "end":
753
- return _context14.stop();
754
- }
755
- }, _callee14);
756
- })));
757
- });
758
628
  });
759
629
  describe('State Machine handler tests', function () {
760
630
  var deviceId = '55dfb53f-bed2-36da-8e85-cee7f02aa68e';
@@ -772,10 +642,10 @@ describe('State Machine handler tests', function () {
772
642
  var call;
773
643
  var dtmfMock;
774
644
  beforeEach(function () {
775
- call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
645
+ call = new _call.Call(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
776
646
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
777
647
  var dummy = 10;
778
- }, defaultServiceIndicator, dest);
648
+ }, defaultServiceIndicator);
779
649
  jest.clearAllTimers();
780
650
  jest.useFakeTimers();
781
651
  call['callStateMachine'].state.value = 'S_IDLE';
@@ -785,10 +655,10 @@ describe('State Machine handler tests', function () {
785
655
 
786
656
  // afterEach(() => call.removeAllListeners());
787
657
 
788
- it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
658
+ it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
789
659
  var statusPayload, dummyEvent, funcSpy, logSpy;
790
- return _regenerator.default.wrap(function _callee15$(_context15) {
791
- while (1) switch (_context15.prev = _context15.next) {
660
+ return _regenerator.default.wrap(function _callee12$(_context12) {
661
+ while (1) switch (_context12.prev = _context12.next) {
792
662
  case 0:
793
663
  statusPayload = {
794
664
  statusCode: 200,
@@ -808,7 +678,7 @@ describe('State Machine handler tests', function () {
808
678
  /* This is to flush all the promises from the Promise queue so that
809
679
  * Jest.fakeTimers can advance time and also clear the promise Queue
810
680
  */
811
- _context15.next = 11;
681
+ _context12.next = 11;
812
682
  return (0, _testUtil.flushPromises)(3);
813
683
  case 11:
814
684
  expect(setInterval).toHaveBeenCalledTimes(1);
@@ -819,14 +689,14 @@ describe('State Machine handler tests', function () {
819
689
  });
820
690
  case 14:
821
691
  case "end":
822
- return _context15.stop();
692
+ return _context12.stop();
823
693
  }
824
- }, _callee15);
694
+ }, _callee12);
825
695
  })));
826
- it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
696
+ it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
827
697
  var statusPayload, funcSpy;
828
- return _regenerator.default.wrap(function _callee16$(_context16) {
829
- while (1) switch (_context16.prev = _context16.next) {
698
+ return _regenerator.default.wrap(function _callee13$(_context13) {
699
+ while (1) switch (_context13.prev = _context13.next) {
830
700
  case 0:
831
701
  expect.assertions(4);
832
702
  statusPayload = {
@@ -850,24 +720,24 @@ describe('State Machine handler tests', function () {
850
720
  /* This is to flush all the promises from the Promise queue so that
851
721
  * Jest.fakeTimers can advance time and also clear the promise Queue
852
722
  */
853
- _context16.next = 11;
723
+ _context13.next = 11;
854
724
  return _promise.default.resolve();
855
725
  case 11:
856
- _context16.next = 13;
726
+ _context13.next = 13;
857
727
  return _promise.default.resolve();
858
728
  case 13:
859
729
  expect(clearInterval).toHaveBeenCalledTimes(1);
860
730
  expect(funcSpy).toBeCalledTimes(1);
861
731
  case 15:
862
732
  case "end":
863
- return _context16.stop();
733
+ return _context13.stop();
864
734
  }
865
- }, _callee16);
735
+ }, _callee13);
866
736
  })));
867
- it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
737
+ it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
868
738
  var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
869
- return _regenerator.default.wrap(function _callee17$(_context17) {
870
- while (1) switch (_context17.prev = _context17.next) {
739
+ return _regenerator.default.wrap(function _callee14$(_context14) {
740
+ while (1) switch (_context14.prev = _context14.next) {
871
741
  case 0:
872
742
  statusPayload = {
873
743
  statusCode: 200,
@@ -923,14 +793,14 @@ describe('State Machine handler tests', function () {
923
793
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
924
794
  case 27:
925
795
  case "end":
926
- return _context17.stop();
796
+ return _context14.stop();
927
797
  }
928
- }, _callee17);
798
+ }, _callee14);
929
799
  })));
930
- it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
800
+ it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
931
801
  var statusPayload, dummyEvent;
932
- return _regenerator.default.wrap(function _callee18$(_context18) {
933
- while (1) switch (_context18.prev = _context18.next) {
802
+ return _regenerator.default.wrap(function _callee15$(_context15) {
803
+ while (1) switch (_context15.prev = _context15.next) {
934
804
  case 0:
935
805
  call['direction'] = _types3.CallDirection.INBOUND;
936
806
  statusPayload = {
@@ -948,7 +818,7 @@ describe('State Machine handler tests', function () {
948
818
  webex.request.mockReturnValue(statusPayload);
949
819
  call.sendCallStateMachineEvt(dummyEvent);
950
820
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
951
- _context18.next = 8;
821
+ _context15.next = 8;
952
822
  return call['handleOutgoingCallConnect']({
953
823
  type: 'E_SEND_CALL_CONNECT'
954
824
  });
@@ -962,14 +832,14 @@ describe('State Machine handler tests', function () {
962
832
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
963
833
  case 12:
964
834
  case "end":
965
- return _context18.stop();
835
+ return _context15.stop();
966
836
  }
967
- }, _callee18);
837
+ }, _callee15);
968
838
  })));
969
- it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
839
+ it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
970
840
  var warnSpy, stateMachineSpy, statusPayload, roapMessage;
971
- return _regenerator.default.wrap(function _callee19$(_context19) {
972
- while (1) switch (_context19.prev = _context19.next) {
841
+ return _regenerator.default.wrap(function _callee16$(_context16) {
842
+ while (1) switch (_context16.prev = _context16.next) {
973
843
  case 0:
974
844
  warnSpy = jest.spyOn(_Logger.default, 'warn');
975
845
  stateMachineSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
@@ -995,7 +865,7 @@ describe('State Machine handler tests', function () {
995
865
  webex.request.mockRejectedValueOnce({
996
866
  statusCode: 403
997
867
  }).mockResolvedValue(statusPayload);
998
- _context19.next = 12;
868
+ _context16.next = 12;
999
869
  return call['handleOutgoingCallConnect']({
1000
870
  type: 'E_SEND_CALL_CONNECT'
1001
871
  });
@@ -1005,14 +875,14 @@ describe('State Machine handler tests', function () {
1005
875
  expect(warnSpy).toBeCalledTimes(4);
1006
876
  case 15:
1007
877
  case "end":
1008
- return _context19.stop();
878
+ return _context16.stop();
1009
879
  }
1010
- }, _callee19);
880
+ }, _callee16);
1011
881
  })));
1012
- it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
882
+ it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
1013
883
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent;
1014
- return _regenerator.default.wrap(function _callee20$(_context20) {
1015
- while (1) switch (_context20.prev = _context20.next) {
884
+ return _regenerator.default.wrap(function _callee17$(_context17) {
885
+ while (1) switch (_context17.prev = _context17.next) {
1016
886
  case 0:
1017
887
  statusPayload = {
1018
888
  statusCode: 200,
@@ -1086,14 +956,14 @@ describe('State Machine handler tests', function () {
1086
956
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1087
957
  case 40:
1088
958
  case "end":
1089
- return _context20.stop();
959
+ return _context17.stop();
1090
960
  }
1091
- }, _callee20);
961
+ }, _callee17);
1092
962
  })));
1093
- 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 _callee21() {
963
+ 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 _callee18() {
1094
964
  var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
1095
- return _regenerator.default.wrap(function _callee21$(_context21) {
1096
- while (1) switch (_context21.prev = _context21.next) {
965
+ return _regenerator.default.wrap(function _callee18$(_context18) {
966
+ while (1) switch (_context18.prev = _context18.next) {
1097
967
  case 0:
1098
968
  statusPayload = {
1099
969
  statusCode: 200,
@@ -1161,14 +1031,14 @@ describe('State Machine handler tests', function () {
1161
1031
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1162
1032
  case 25:
1163
1033
  case "end":
1164
- return _context21.stop();
1034
+ return _context18.stop();
1165
1035
  }
1166
- }, _callee21);
1036
+ }, _callee18);
1167
1037
  })));
1168
- it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
1038
+ it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
1169
1039
  var statusPayload, dummyEvent;
1170
- return _regenerator.default.wrap(function _callee22$(_context22) {
1171
- while (1) switch (_context22.prev = _context22.next) {
1040
+ return _regenerator.default.wrap(function _callee19$(_context19) {
1041
+ while (1) switch (_context19.prev = _context19.next) {
1172
1042
  case 0:
1173
1043
  statusPayload = {
1174
1044
  statusCode: 200,
@@ -1207,14 +1077,14 @@ describe('State Machine handler tests', function () {
1207
1077
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1208
1078
  case 17:
1209
1079
  case "end":
1210
- return _context22.stop();
1080
+ return _context19.stop();
1211
1081
  }
1212
- }, _callee22);
1082
+ }, _callee19);
1213
1083
  })));
1214
- it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
1084
+ it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
1215
1085
  var statusPayload, dummyEvent;
1216
- return _regenerator.default.wrap(function _callee23$(_context23) {
1217
- while (1) switch (_context23.prev = _context23.next) {
1086
+ return _regenerator.default.wrap(function _callee20$(_context20) {
1087
+ while (1) switch (_context20.prev = _context20.next) {
1218
1088
  case 0:
1219
1089
  statusPayload = {
1220
1090
  statusCode: 403,
@@ -1230,20 +1100,20 @@ describe('State Machine handler tests', function () {
1230
1100
  };
1231
1101
  webex.request.mockRejectedValueOnce(statusPayload);
1232
1102
  call.sendCallStateMachineEvt(dummyEvent);
1233
- _context23.next = 6;
1103
+ _context20.next = 6;
1234
1104
  return (0, _testUtil.flushPromises)(3);
1235
1105
  case 6:
1236
1106
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
1237
1107
  case 7:
1238
1108
  case "end":
1239
- return _context23.stop();
1109
+ return _context20.stop();
1240
1110
  }
1241
- }, _callee23);
1111
+ }, _callee20);
1242
1112
  })));
1243
- it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
1113
+ it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
1244
1114
  var statusPayload, dummyEvent;
1245
- return _regenerator.default.wrap(function _callee24$(_context24) {
1246
- while (1) switch (_context24.prev = _context24.next) {
1115
+ return _regenerator.default.wrap(function _callee21$(_context21) {
1116
+ while (1) switch (_context21.prev = _context21.next) {
1247
1117
  case 0:
1248
1118
  statusPayload = {
1249
1119
  statusCode: 403,
@@ -1260,10 +1130,10 @@ describe('State Machine handler tests', function () {
1260
1130
  call['earlyMedia'] = true;
1261
1131
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1262
1132
  webex.request.mockRejectedValue(statusPayload);
1263
- _context24.next = 8;
1133
+ _context21.next = 8;
1264
1134
  return call['handleRoapEstablished']({}, dummyEvent);
1265
1135
  case 8:
1266
- _context24.next = 10;
1136
+ _context21.next = 10;
1267
1137
  return (0, _testUtil.flushPromises)(2);
1268
1138
  case 10:
1269
1139
  expect(call.isConnected()).toBe(false);
@@ -1271,14 +1141,14 @@ describe('State Machine handler tests', function () {
1271
1141
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
1272
1142
  case 13:
1273
1143
  case "end":
1274
- return _context24.stop();
1144
+ return _context21.stop();
1275
1145
  }
1276
- }, _callee24);
1146
+ }, _callee21);
1277
1147
  })));
1278
- it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
1148
+ it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
1279
1149
  var statusPayload, dummyEvent;
1280
- return _regenerator.default.wrap(function _callee25$(_context25) {
1281
- while (1) switch (_context25.prev = _context25.next) {
1150
+ return _regenerator.default.wrap(function _callee22$(_context22) {
1151
+ while (1) switch (_context22.prev = _context22.next) {
1282
1152
  case 0:
1283
1153
  statusPayload = {
1284
1154
  statusCode: 403,
@@ -1301,14 +1171,14 @@ describe('State Machine handler tests', function () {
1301
1171
  expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
1302
1172
  case 8:
1303
1173
  case "end":
1304
- return _context25.stop();
1174
+ return _context22.stop();
1305
1175
  }
1306
- }, _callee25);
1176
+ }, _callee22);
1307
1177
  })));
1308
- it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
1178
+ it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
1309
1179
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1310
- return _regenerator.default.wrap(function _callee26$(_context26) {
1311
- while (1) switch (_context26.prev = _context26.next) {
1180
+ return _regenerator.default.wrap(function _callee23$(_context23) {
1181
+ while (1) switch (_context23.prev = _context23.next) {
1312
1182
  case 0:
1313
1183
  statusPayload = {
1314
1184
  statusCode: 503,
@@ -1330,7 +1200,7 @@ describe('State Machine handler tests', function () {
1330
1200
  }
1331
1201
  };
1332
1202
  call['connected'] = true;
1333
- _context26.next = 8;
1203
+ _context23.next = 8;
1334
1204
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1335
1205
  case 8:
1336
1206
  jest.advanceTimersByTime(1005);
@@ -1342,14 +1212,14 @@ describe('State Machine handler tests', function () {
1342
1212
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1343
1213
  case 13:
1344
1214
  case "end":
1345
- return _context26.stop();
1215
+ return _context23.stop();
1346
1216
  }
1347
- }, _callee26);
1217
+ }, _callee23);
1348
1218
  })));
1349
- it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
1219
+ it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
1350
1220
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1351
- return _regenerator.default.wrap(function _callee27$(_context27) {
1352
- while (1) switch (_context27.prev = _context27.next) {
1221
+ return _regenerator.default.wrap(function _callee24$(_context24) {
1222
+ while (1) switch (_context24.prev = _context24.next) {
1353
1223
  case 0:
1354
1224
  statusPayload = {
1355
1225
  statusCode: 503,
@@ -1371,7 +1241,7 @@ describe('State Machine handler tests', function () {
1371
1241
  }
1372
1242
  };
1373
1243
  call['connected'] = false;
1374
- _context27.next = 8;
1244
+ _context24.next = 8;
1375
1245
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1376
1246
  case 8:
1377
1247
  jest.advanceTimersByTime(1005);
@@ -1382,14 +1252,14 @@ describe('State Machine handler tests', function () {
1382
1252
  expect(stateMachineSpy).not.toBeCalled();
1383
1253
  case 12:
1384
1254
  case "end":
1385
- return _context27.stop();
1255
+ return _context24.stop();
1386
1256
  }
1387
- }, _callee27);
1257
+ }, _callee24);
1388
1258
  })));
1389
- it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
1259
+ it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
1390
1260
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1391
- return _regenerator.default.wrap(function _callee28$(_context28) {
1392
- while (1) switch (_context28.prev = _context28.next) {
1261
+ return _regenerator.default.wrap(function _callee25$(_context25) {
1262
+ while (1) switch (_context25.prev = _context25.next) {
1393
1263
  case 0:
1394
1264
  statusPayload = {
1395
1265
  statusCode: 503,
@@ -1411,7 +1281,7 @@ describe('State Machine handler tests', function () {
1411
1281
  };
1412
1282
  call['connected'] = true;
1413
1283
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
1414
- _context28.next = 9;
1284
+ _context25.next = 9;
1415
1285
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1416
1286
  case 9:
1417
1287
  jest.advanceTimersByTime(1005);
@@ -1423,14 +1293,14 @@ describe('State Machine handler tests', function () {
1423
1293
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1424
1294
  case 14:
1425
1295
  case "end":
1426
- return _context28.stop();
1296
+ return _context25.stop();
1427
1297
  }
1428
- }, _callee28);
1298
+ }, _callee25);
1429
1299
  })));
1430
- it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
1300
+ it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
1431
1301
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1432
- return _regenerator.default.wrap(function _callee29$(_context29) {
1433
- while (1) switch (_context29.prev = _context29.next) {
1302
+ return _regenerator.default.wrap(function _callee26$(_context26) {
1303
+ while (1) switch (_context26.prev = _context26.next) {
1434
1304
  case 0:
1435
1305
  statusPayload = {
1436
1306
  statusCode: 503,
@@ -1451,7 +1321,7 @@ describe('State Machine handler tests', function () {
1451
1321
  }
1452
1322
  };
1453
1323
  call['connected'] = false;
1454
- _context29.next = 8;
1324
+ _context26.next = 8;
1455
1325
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1456
1326
  case 8:
1457
1327
  jest.advanceTimersByTime(1005);
@@ -1463,14 +1333,14 @@ describe('State Machine handler tests', function () {
1463
1333
  expect(stateMachineSpy).not.toBeCalled();
1464
1334
  case 13:
1465
1335
  case "end":
1466
- return _context29.stop();
1336
+ return _context26.stop();
1467
1337
  }
1468
- }, _callee29);
1338
+ }, _callee26);
1469
1339
  })));
1470
- it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
1340
+ it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
1471
1341
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1472
- return _regenerator.default.wrap(function _callee30$(_context30) {
1473
- while (1) switch (_context30.prev = _context30.next) {
1342
+ return _regenerator.default.wrap(function _callee27$(_context27) {
1343
+ while (1) switch (_context27.prev = _context27.next) {
1474
1344
  case 0:
1475
1345
  statusPayload = {
1476
1346
  statusCode: 200,
@@ -1495,14 +1365,14 @@ describe('State Machine handler tests', function () {
1495
1365
  expect(stateMachineSpy).not.toHaveBeenCalled();
1496
1366
  case 11:
1497
1367
  case "end":
1498
- return _context30.stop();
1368
+ return _context27.stop();
1499
1369
  }
1500
- }, _callee30);
1370
+ }, _callee27);
1501
1371
  })));
1502
- it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
1372
+ it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
1503
1373
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1504
- return _regenerator.default.wrap(function _callee31$(_context31) {
1505
- while (1) switch (_context31.prev = _context31.next) {
1374
+ return _regenerator.default.wrap(function _callee28$(_context28) {
1375
+ while (1) switch (_context28.prev = _context28.next) {
1506
1376
  case 0:
1507
1377
  statusPayload = {
1508
1378
  statusCode: 503,
@@ -1524,7 +1394,7 @@ describe('State Machine handler tests', function () {
1524
1394
  };
1525
1395
  call['connected'] = true;
1526
1396
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1527
- _context31.next = 9;
1397
+ _context28.next = 9;
1528
1398
  return call['handleRoapEstablished']({}, dummyEvent);
1529
1399
  case 9:
1530
1400
  jest.advanceTimersByTime(1005);
@@ -1536,14 +1406,14 @@ describe('State Machine handler tests', function () {
1536
1406
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1537
1407
  case 14:
1538
1408
  case "end":
1539
- return _context31.stop();
1409
+ return _context28.stop();
1540
1410
  }
1541
- }, _callee31);
1411
+ }, _callee28);
1542
1412
  })));
1543
- it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
1413
+ it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
1544
1414
  var statusPayload, stateMachineSpy, funcSpy, errorEvent;
1545
- return _regenerator.default.wrap(function _callee32$(_context32) {
1546
- while (1) switch (_context32.prev = _context32.next) {
1415
+ return _regenerator.default.wrap(function _callee29$(_context29) {
1416
+ while (1) switch (_context29.prev = _context29.next) {
1547
1417
  case 0:
1548
1418
  statusPayload = {
1549
1419
  statusCode: 403,
@@ -1566,14 +1436,14 @@ describe('State Machine handler tests', function () {
1566
1436
  expect(stateMachineSpy).not.toHaveBeenCalled();
1567
1437
  case 9:
1568
1438
  case "end":
1569
- return _context32.stop();
1439
+ return _context29.stop();
1570
1440
  }
1571
- }, _callee32);
1441
+ }, _callee29);
1572
1442
  })));
1573
- it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
1443
+ it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
1574
1444
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1575
- return _regenerator.default.wrap(function _callee33$(_context33) {
1576
- while (1) switch (_context33.prev = _context33.next) {
1445
+ return _regenerator.default.wrap(function _callee30$(_context30) {
1446
+ while (1) switch (_context30.prev = _context30.next) {
1577
1447
  case 0:
1578
1448
  statusPayload = {
1579
1449
  statusCode: 200,
@@ -1591,7 +1461,7 @@ describe('State Machine handler tests', function () {
1591
1461
  }
1592
1462
  };
1593
1463
  call['connected'] = false;
1594
- _context33.next = 8;
1464
+ _context30.next = 8;
1595
1465
  return call['handleRoapError']({}, errorEvent);
1596
1466
  case 8:
1597
1467
  expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
@@ -1607,14 +1477,14 @@ describe('State Machine handler tests', function () {
1607
1477
  });
1608
1478
  case 11:
1609
1479
  case "end":
1610
- return _context33.stop();
1480
+ return _context30.stop();
1611
1481
  }
1612
- }, _callee33);
1482
+ }, _callee30);
1613
1483
  })));
1614
- it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
1484
+ it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
1615
1485
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1616
- return _regenerator.default.wrap(function _callee34$(_context34) {
1617
- while (1) switch (_context34.prev = _context34.next) {
1486
+ return _regenerator.default.wrap(function _callee31$(_context31) {
1487
+ while (1) switch (_context31.prev = _context31.next) {
1618
1488
  case 0:
1619
1489
  statusPayload = {
1620
1490
  statusCode: 200,
@@ -1647,7 +1517,7 @@ describe('State Machine handler tests', function () {
1647
1517
  seq: 1,
1648
1518
  messageType: 'ANSWER'
1649
1519
  };
1650
- _context34.next = 17;
1520
+ _context31.next = 17;
1651
1521
  return call.sendMediaStateMachineEvt(dummyEvent);
1652
1522
  case 17:
1653
1523
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1669,7 +1539,7 @@ describe('State Machine handler tests', function () {
1669
1539
  seq: 2,
1670
1540
  messageType: 'OFFER_REQUEST'
1671
1541
  };
1672
- _context34.next = 23;
1542
+ _context31.next = 23;
1673
1543
  return call.sendMediaStateMachineEvt(dummyEvent);
1674
1544
  case 23:
1675
1545
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1719,7 +1589,7 @@ describe('State Machine handler tests', function () {
1719
1589
  };
1720
1590
  call.sendCallStateMachineEvt(dummyEvent);
1721
1591
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
1722
- _context34.next = 49;
1592
+ _context31.next = 49;
1723
1593
  return call.sendMediaStateMachineEvt(dummyEvent);
1724
1594
  case 49:
1725
1595
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1728,7 +1598,7 @@ describe('State Machine handler tests', function () {
1728
1598
  seq: 3,
1729
1599
  messageType: 'ANSWER'
1730
1600
  };
1731
- _context34.next = 54;
1601
+ _context31.next = 54;
1732
1602
  return call.sendMediaStateMachineEvt(dummyEvent);
1733
1603
  case 54:
1734
1604
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1747,7 +1617,7 @@ describe('State Machine handler tests', function () {
1747
1617
  messageType: 'OK'
1748
1618
  }
1749
1619
  };
1750
- _context34.next = 63;
1620
+ _context31.next = 63;
1751
1621
  return call.sendMediaStateMachineEvt(dummyOkEvent);
1752
1622
  case 63:
1753
1623
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
@@ -1762,14 +1632,14 @@ describe('State Machine handler tests', function () {
1762
1632
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
1763
1633
  case 70:
1764
1634
  case "end":
1765
- return _context34.stop();
1635
+ return _context31.stop();
1766
1636
  }
1767
- }, _callee34);
1637
+ }, _callee31);
1768
1638
  })));
1769
- it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
1639
+ it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
1770
1640
  var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1771
- return _regenerator.default.wrap(function _callee35$(_context35) {
1772
- while (1) switch (_context35.prev = _context35.next) {
1641
+ return _regenerator.default.wrap(function _callee32$(_context32) {
1642
+ while (1) switch (_context32.prev = _context32.next) {
1773
1643
  case 0:
1774
1644
  mockStatusBody = {
1775
1645
  device: {
@@ -1809,7 +1679,7 @@ describe('State Machine handler tests', function () {
1809
1679
  seq: 1,
1810
1680
  messageType: 'ANSWER'
1811
1681
  };
1812
- _context35.next = 18;
1682
+ _context32.next = 18;
1813
1683
  return call.sendMediaStateMachineEvt(dummyEvent);
1814
1684
  case 18:
1815
1685
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1831,7 +1701,7 @@ describe('State Machine handler tests', function () {
1831
1701
  seq: 2,
1832
1702
  messageType: 'OFFER_REQUEST'
1833
1703
  };
1834
- _context35.next = 24;
1704
+ _context32.next = 24;
1835
1705
  return call.sendMediaStateMachineEvt(dummyEvent);
1836
1706
  case 24:
1837
1707
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1881,7 +1751,7 @@ describe('State Machine handler tests', function () {
1881
1751
  };
1882
1752
  call.sendCallStateMachineEvt(dummyEvent);
1883
1753
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
1884
- _context35.next = 50;
1754
+ _context32.next = 50;
1885
1755
  return call.sendMediaStateMachineEvt(dummyEvent);
1886
1756
  case 50:
1887
1757
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1890,7 +1760,7 @@ describe('State Machine handler tests', function () {
1890
1760
  seq: 3,
1891
1761
  messageType: 'ANSWER'
1892
1762
  };
1893
- _context35.next = 55;
1763
+ _context32.next = 55;
1894
1764
  return call.sendMediaStateMachineEvt(dummyEvent);
1895
1765
  case 55:
1896
1766
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1907,7 +1777,7 @@ describe('State Machine handler tests', function () {
1907
1777
  }
1908
1778
  };
1909
1779
  call.sendMediaStateMachineEvt(dummyEvent);
1910
- _context35.next = 62;
1780
+ _context32.next = 62;
1911
1781
  return call.sendMediaStateMachineEvt(dummyOkEvent);
1912
1782
  case 62:
1913
1783
  expect(call['receivedRoapOKSeq']).toBe(3);
@@ -1923,14 +1793,14 @@ describe('State Machine handler tests', function () {
1923
1793
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
1924
1794
  case 70:
1925
1795
  case "end":
1926
- return _context35.stop();
1796
+ return _context32.stop();
1927
1797
  }
1928
- }, _callee35);
1798
+ }, _callee32);
1929
1799
  })));
1930
- it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
1800
+ it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
1931
1801
  var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
1932
- return _regenerator.default.wrap(function _callee36$(_context36) {
1933
- while (1) switch (_context36.prev = _context36.next) {
1802
+ return _regenerator.default.wrap(function _callee33$(_context33) {
1803
+ while (1) switch (_context33.prev = _context33.next) {
1934
1804
  case 0:
1935
1805
  statusPayload = {
1936
1806
  statusCode: 200,
@@ -1997,9 +1867,9 @@ describe('State Machine handler tests', function () {
1997
1867
  });
1998
1868
  case 33:
1999
1869
  case "end":
2000
- return _context36.stop();
1870
+ return _context33.stop();
2001
1871
  }
2002
- }, _callee36);
1872
+ }, _callee33);
2003
1873
  })));
2004
1874
  describe('Call event timers tests', function () {
2005
1875
  var callManager;
@@ -2010,10 +1880,10 @@ describe('State Machine handler tests', function () {
2010
1880
  afterEach(function () {
2011
1881
  jest.clearAllTimers();
2012
1882
  });
2013
- it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
1883
+ it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
2014
1884
  var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
2015
- return _regenerator.default.wrap(function _callee37$(_context37) {
2016
- while (1) switch (_context37.prev = _context37.next) {
1885
+ return _regenerator.default.wrap(function _callee34$(_context34) {
1886
+ while (1) switch (_context34.prev = _context34.next) {
2017
1887
  case 0:
2018
1888
  statusPayload = {
2019
1889
  statusCode: 200,
@@ -2030,7 +1900,7 @@ describe('State Machine handler tests', function () {
2030
1900
  webex.request.mockReturnValue(statusPayload);
2031
1901
 
2032
1902
  // handleOutgoingCallSetup is asynchronous
2033
- _context37.next = 9;
1903
+ _context34.next = 9;
2034
1904
  return call.sendCallStateMachineEvt(dummyEvent);
2035
1905
  case 9:
2036
1906
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2073,14 +1943,14 @@ describe('State Machine handler tests', function () {
2073
1943
  expect(callManager.callCollection).toStrictEqual({});
2074
1944
  case 32:
2075
1945
  case "end":
2076
- return _context37.stop();
1946
+ return _context34.stop();
2077
1947
  }
2078
- }, _callee37);
1948
+ }, _callee34);
2079
1949
  })));
2080
- it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
1950
+ it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
2081
1951
  var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
2082
- return _regenerator.default.wrap(function _callee38$(_context38) {
2083
- while (1) switch (_context38.prev = _context38.next) {
1952
+ return _regenerator.default.wrap(function _callee35$(_context35) {
1953
+ while (1) switch (_context35.prev = _context35.next) {
2084
1954
  case 0:
2085
1955
  statusPayload = {
2086
1956
  statusCode: 200,
@@ -2099,7 +1969,7 @@ describe('State Machine handler tests', function () {
2099
1969
  expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
2100
1970
 
2101
1971
  // handleOutgoingCallSetup is asynchronous
2102
- _context38.next = 11;
1972
+ _context35.next = 11;
2103
1973
  return call.sendCallStateMachineEvt(dummyEvent);
2104
1974
  case 11:
2105
1975
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -2111,9 +1981,9 @@ describe('State Machine handler tests', function () {
2111
1981
  expect(callManager.callCollection).toStrictEqual({});
2112
1982
  case 18:
2113
1983
  case "end":
2114
- return _context38.stop();
1984
+ return _context35.stop();
2115
1985
  }
2116
- }, _callee38);
1986
+ }, _callee35);
2117
1987
  })));
2118
1988
  });
2119
1989
  });
@@ -2136,10 +2006,10 @@ describe('Supplementary Services tests', function () {
2136
2006
  * parameters manually
2137
2007
  */
2138
2008
 
2139
- call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2009
+ call = new _call.Call(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2140
2010
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2141
2011
  var dummy = 10;
2142
- }, defaultServiceIndicator, dest);
2012
+ }, defaultServiceIndicator);
2143
2013
  call['connected'] = true;
2144
2014
  call['earlyMedia'] = false;
2145
2015
 
@@ -2173,10 +2043,10 @@ describe('Supplementary Services tests', function () {
2173
2043
  beforeEach(function () {
2174
2044
  call.removeAllListeners();
2175
2045
  });
2176
- it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
2046
+ it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
2177
2047
  var responsePayload, warnSpy, roapEvent;
2178
- return _regenerator.default.wrap(function _callee40$(_context40) {
2179
- while (1) switch (_context40.prev = _context40.next) {
2048
+ return _regenerator.default.wrap(function _callee37$(_context37) {
2049
+ while (1) switch (_context37.prev = _context37.next) {
2180
2050
  case 0:
2181
2051
  expect.assertions(7);
2182
2052
  responsePayload = {
@@ -2189,25 +2059,25 @@ describe('Supplementary Services tests', function () {
2189
2059
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2190
2060
  call['held'] = false;
2191
2061
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2192
- var _ref40 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(correlationId) {
2193
- return _regenerator.default.wrap(function _callee39$(_context39) {
2194
- while (1) switch (_context39.prev = _context39.next) {
2062
+ var _ref37 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(correlationId) {
2063
+ return _regenerator.default.wrap(function _callee36$(_context36) {
2064
+ while (1) switch (_context36.prev = _context36.next) {
2195
2065
  case 0:
2196
2066
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2197
2067
  case 1:
2198
2068
  case "end":
2199
- return _context39.stop();
2069
+ return _context36.stop();
2200
2070
  }
2201
- }, _callee39);
2071
+ }, _callee36);
2202
2072
  }));
2203
2073
  return function (_x) {
2204
- return _ref40.apply(this, arguments);
2074
+ return _ref37.apply(this, arguments);
2205
2075
  };
2206
2076
  }());
2207
- _context40.next = 10;
2077
+ _context37.next = 10;
2208
2078
  return call.doHoldResume();
2209
2079
  case 10:
2210
- _context40.next = 12;
2080
+ _context37.next = 12;
2211
2081
  return (0, _testUtil.flushPromises)(2);
2212
2082
  case 12:
2213
2083
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2223,11 +2093,11 @@ describe('Supplementary Services tests', function () {
2223
2093
  call['handleIncomingRoapOffer']({}, dummyEvent);
2224
2094
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2225
2095
  roapEvent.data.type = 'ANSWER';
2226
- _context40.next = 20;
2096
+ _context37.next = 20;
2227
2097
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2228
2098
  case 20:
2229
2099
  roapEvent.data.type = 'OK';
2230
- _context40.next = 23;
2100
+ _context37.next = 23;
2231
2101
  return call['handleRoapEstablished']({}, dummyEvent);
2232
2102
  case 23:
2233
2103
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2242,14 +2112,14 @@ describe('Supplementary Services tests', function () {
2242
2112
  });
2243
2113
  case 28:
2244
2114
  case "end":
2245
- return _context40.stop();
2115
+ return _context37.stop();
2246
2116
  }
2247
- }, _callee40);
2117
+ }, _callee37);
2248
2118
  })));
2249
- it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
2119
+ it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
2250
2120
  var responsePayload, warnSpy, roapEvent;
2251
- return _regenerator.default.wrap(function _callee42$(_context42) {
2252
- while (1) switch (_context42.prev = _context42.next) {
2121
+ return _regenerator.default.wrap(function _callee39$(_context39) {
2122
+ while (1) switch (_context39.prev = _context39.next) {
2253
2123
  case 0:
2254
2124
  expect.assertions(8);
2255
2125
  responsePayload = {
@@ -2262,26 +2132,26 @@ describe('Supplementary Services tests', function () {
2262
2132
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2263
2133
  call['held'] = false;
2264
2134
  call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
2265
- var _ref42 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(correlationId) {
2266
- return _regenerator.default.wrap(function _callee41$(_context41) {
2267
- while (1) switch (_context41.prev = _context41.next) {
2135
+ var _ref39 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(correlationId) {
2136
+ return _regenerator.default.wrap(function _callee38$(_context38) {
2137
+ while (1) switch (_context38.prev = _context38.next) {
2268
2138
  case 0:
2269
2139
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2270
2140
  case 1:
2271
2141
  case "end":
2272
- return _context41.stop();
2142
+ return _context38.stop();
2273
2143
  }
2274
- }, _callee41);
2144
+ }, _callee38);
2275
2145
  }));
2276
2146
  return function (_x2) {
2277
- return _ref42.apply(this, arguments);
2147
+ return _ref39.apply(this, arguments);
2278
2148
  };
2279
2149
  }());
2280
2150
  call.doHoldResume();
2281
- _context42.next = 11;
2151
+ _context39.next = 11;
2282
2152
  return _promise.default.resolve();
2283
2153
  case 11:
2284
- _context42.next = 13;
2154
+ _context39.next = 13;
2285
2155
  return _promise.default.resolve();
2286
2156
  case 13:
2287
2157
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2297,11 +2167,11 @@ describe('Supplementary Services tests', function () {
2297
2167
  call['handleIncomingRoapOffer']({}, dummyEvent);
2298
2168
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2299
2169
  roapEvent.data.type = 'ANSWER';
2300
- _context42.next = 22;
2170
+ _context39.next = 22;
2301
2171
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2302
2172
  case 22:
2303
2173
  roapEvent.data.type = 'OK';
2304
- _context42.next = 25;
2174
+ _context39.next = 25;
2305
2175
  return call['handleRoapEstablished']({}, dummyEvent);
2306
2176
  case 25:
2307
2177
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2316,14 +2186,14 @@ describe('Supplementary Services tests', function () {
2316
2186
  });
2317
2187
  case 30:
2318
2188
  case "end":
2319
- return _context42.stop();
2189
+ return _context39.stop();
2320
2190
  }
2321
- }, _callee42);
2191
+ }, _callee39);
2322
2192
  })));
2323
- it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
2193
+ it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
2324
2194
  var responsePayload;
2325
- return _regenerator.default.wrap(function _callee44$(_context44) {
2326
- while (1) switch (_context44.prev = _context44.next) {
2195
+ return _regenerator.default.wrap(function _callee41$(_context41) {
2196
+ while (1) switch (_context41.prev = _context41.next) {
2327
2197
  case 0:
2328
2198
  expect.assertions(4);
2329
2199
  responsePayload = {
@@ -2333,26 +2203,26 @@ describe('Supplementary Services tests', function () {
2333
2203
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2334
2204
  call['held'] = false;
2335
2205
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2336
- var _ref44 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(errObj) {
2337
- return _regenerator.default.wrap(function _callee43$(_context43) {
2338
- while (1) switch (_context43.prev = _context43.next) {
2206
+ var _ref41 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(errObj) {
2207
+ return _regenerator.default.wrap(function _callee40$(_context40) {
2208
+ while (1) switch (_context40.prev = _context40.next) {
2339
2209
  case 0:
2340
2210
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2341
2211
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2342
2212
  case 2:
2343
2213
  case "end":
2344
- return _context43.stop();
2214
+ return _context40.stop();
2345
2215
  }
2346
- }, _callee43);
2216
+ }, _callee40);
2347
2217
  }));
2348
2218
  return function (_x3) {
2349
- return _ref44.apply(this, arguments);
2219
+ return _ref41.apply(this, arguments);
2350
2220
  };
2351
2221
  }());
2352
- _context44.next = 7;
2222
+ _context41.next = 7;
2353
2223
  return call.doHoldResume();
2354
2224
  case 7:
2355
- _context44.next = 9;
2225
+ _context41.next = 9;
2356
2226
  return (0, _testUtil.flushPromises)(2);
2357
2227
  case 9:
2358
2228
  expect(call.isHeld()).toStrictEqual(false);
@@ -2362,14 +2232,14 @@ describe('Supplementary Services tests', function () {
2362
2232
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2363
2233
  case 11:
2364
2234
  case "end":
2365
- return _context44.stop();
2235
+ return _context41.stop();
2366
2236
  }
2367
- }, _callee44);
2237
+ }, _callee41);
2368
2238
  })));
2369
- it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
2239
+ it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
2370
2240
  var responsePayload, rejectPayload, roapEvent;
2371
- return _regenerator.default.wrap(function _callee46$(_context46) {
2372
- while (1) switch (_context46.prev = _context46.next) {
2241
+ return _regenerator.default.wrap(function _callee43$(_context43) {
2242
+ while (1) switch (_context43.prev = _context43.next) {
2373
2243
  case 0:
2374
2244
  expect.assertions(5);
2375
2245
  responsePayload = {
@@ -2383,24 +2253,24 @@ describe('Supplementary Services tests', function () {
2383
2253
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2384
2254
  call['held'] = false;
2385
2255
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2386
- var _ref46 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45(errObj) {
2387
- return _regenerator.default.wrap(function _callee45$(_context45) {
2388
- while (1) switch (_context45.prev = _context45.next) {
2256
+ var _ref43 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(errObj) {
2257
+ return _regenerator.default.wrap(function _callee42$(_context42) {
2258
+ while (1) switch (_context42.prev = _context42.next) {
2389
2259
  case 0:
2390
2260
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2391
2261
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2392
2262
  case 2:
2393
2263
  case "end":
2394
- return _context45.stop();
2264
+ return _context42.stop();
2395
2265
  }
2396
- }, _callee45);
2266
+ }, _callee42);
2397
2267
  }));
2398
2268
  return function (_x4) {
2399
- return _ref46.apply(this, arguments);
2269
+ return _ref43.apply(this, arguments);
2400
2270
  };
2401
2271
  }());
2402
2272
  call.doHoldResume();
2403
- _context46.next = 9;
2273
+ _context43.next = 9;
2404
2274
  return (0, _testUtil.flushPromises)(2);
2405
2275
  case 9:
2406
2276
  /* the Call State should transition to S_CALL_ESTABLISHED
@@ -2410,7 +2280,7 @@ describe('Supplementary Services tests', function () {
2410
2280
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2411
2281
  /* We are intentionally failing the ROAP ANSWER */
2412
2282
  roapEvent.data.type = 'ANSWER';
2413
- _context46.next = 15;
2283
+ _context43.next = 15;
2414
2284
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2415
2285
  case 15:
2416
2286
  expect(call.isHeld()).toStrictEqual(false);
@@ -2418,14 +2288,14 @@ describe('Supplementary Services tests', function () {
2418
2288
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2419
2289
  case 17:
2420
2290
  case "end":
2421
- return _context46.stop();
2291
+ return _context43.stop();
2422
2292
  }
2423
- }, _callee46);
2293
+ }, _callee43);
2424
2294
  })));
2425
- it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
2295
+ it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
2426
2296
  var responsePayload, warnSpy, roapEvent;
2427
- return _regenerator.default.wrap(function _callee47$(_context47) {
2428
- while (1) switch (_context47.prev = _context47.next) {
2297
+ return _regenerator.default.wrap(function _callee44$(_context44) {
2298
+ while (1) switch (_context44.prev = _context44.next) {
2429
2299
  case 0:
2430
2300
  responsePayload = {
2431
2301
  statusCode: 200,
@@ -2436,10 +2306,10 @@ describe('Supplementary Services tests', function () {
2436
2306
  jest.spyOn(global, 'clearTimeout');
2437
2307
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2438
2308
  call['held'] = false;
2439
- _context47.next = 8;
2309
+ _context44.next = 8;
2440
2310
  return call.doHoldResume();
2441
2311
  case 8:
2442
- _context47.next = 10;
2312
+ _context44.next = 10;
2443
2313
  return (0, _testUtil.flushPromises)(2);
2444
2314
  case 10:
2445
2315
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2454,19 +2324,19 @@ describe('Supplementary Services tests', function () {
2454
2324
  call['handleIncomingRoapOffer']({}, dummyEvent);
2455
2325
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2456
2326
  roapEvent.data.type = 'ANSWER';
2457
- _context47.next = 17;
2327
+ _context44.next = 17;
2458
2328
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2459
2329
  case 17:
2460
2330
  jest.spyOn(webex, 'request').mockRejectedValue({
2461
2331
  statusCode: 403
2462
2332
  });
2463
2333
  roapEvent.data.type = 'OK';
2464
- _context47.next = 21;
2334
+ _context44.next = 21;
2465
2335
  return call['handleRoapEstablished']({}, dummyEvent);
2466
2336
  case 21:
2467
2337
  /* this is for coverage */
2468
2338
  call['callStateMachine'].state.value = 'S_CALL_HOLD';
2469
- _context47.next = 24;
2339
+ _context44.next = 24;
2470
2340
  return call['handleRoapEstablished']({}, dummyEvent);
2471
2341
  case 24:
2472
2342
  expect(call.isHeld()).toStrictEqual(false);
@@ -2478,14 +2348,14 @@ describe('Supplementary Services tests', function () {
2478
2348
  });
2479
2349
  case 27:
2480
2350
  case "end":
2481
- return _context47.stop();
2351
+ return _context44.stop();
2482
2352
  }
2483
- }, _callee47);
2353
+ }, _callee44);
2484
2354
  })));
2485
- it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
2355
+ it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
2486
2356
  var responsePayload, warnSpy, roapEvent;
2487
- return _regenerator.default.wrap(function _callee48$(_context48) {
2488
- while (1) switch (_context48.prev = _context48.next) {
2357
+ return _regenerator.default.wrap(function _callee45$(_context45) {
2358
+ while (1) switch (_context45.prev = _context45.next) {
2489
2359
  case 0:
2490
2360
  responsePayload = {
2491
2361
  statusCode: 200,
@@ -2496,10 +2366,10 @@ describe('Supplementary Services tests', function () {
2496
2366
  jest.spyOn(global, 'clearTimeout');
2497
2367
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2498
2368
  call['held'] = true;
2499
- _context48.next = 8;
2369
+ _context45.next = 8;
2500
2370
  return call.doHoldResume();
2501
2371
  case 8:
2502
- _context48.next = 10;
2372
+ _context45.next = 10;
2503
2373
  return (0, _testUtil.flushPromises)(2);
2504
2374
  case 10:
2505
2375
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2514,14 +2384,14 @@ describe('Supplementary Services tests', function () {
2514
2384
  call['handleIncomingRoapOffer']({}, dummyEvent);
2515
2385
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2516
2386
  roapEvent.data.type = 'ANSWER';
2517
- _context48.next = 17;
2387
+ _context45.next = 17;
2518
2388
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2519
2389
  case 17:
2520
2390
  jest.spyOn(webex, 'request').mockRejectedValue({
2521
2391
  statusCode: 403
2522
2392
  });
2523
2393
  roapEvent.data.type = 'OK';
2524
- _context48.next = 21;
2394
+ _context45.next = 21;
2525
2395
  return call['handleRoapEstablished']({}, dummyEvent);
2526
2396
  case 21:
2527
2397
  expect(call.isHeld()).toStrictEqual(true);
@@ -2533,14 +2403,14 @@ describe('Supplementary Services tests', function () {
2533
2403
  });
2534
2404
  case 24:
2535
2405
  case "end":
2536
- return _context48.stop();
2406
+ return _context45.stop();
2537
2407
  }
2538
- }, _callee48);
2408
+ }, _callee45);
2539
2409
  })));
2540
- it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
2410
+ it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
2541
2411
  var responsePayload, roapEvent;
2542
- return _regenerator.default.wrap(function _callee50$(_context50) {
2543
- while (1) switch (_context50.prev = _context50.next) {
2412
+ return _regenerator.default.wrap(function _callee47$(_context47) {
2413
+ while (1) switch (_context47.prev = _context47.next) {
2544
2414
  case 0:
2545
2415
  expect.assertions(5);
2546
2416
  responsePayload = {
@@ -2550,25 +2420,25 @@ describe('Supplementary Services tests', function () {
2550
2420
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2551
2421
  call['held'] = false;
2552
2422
  call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
2553
- var _ref50 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
2554
- return _regenerator.default.wrap(function _callee49$(_context49) {
2555
- while (1) switch (_context49.prev = _context49.next) {
2423
+ var _ref47 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46(errObj) {
2424
+ return _regenerator.default.wrap(function _callee46$(_context46) {
2425
+ while (1) switch (_context46.prev = _context46.next) {
2556
2426
  case 0:
2557
2427
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2558
2428
  expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
2559
2429
  case 2:
2560
2430
  case "end":
2561
- return _context49.stop();
2431
+ return _context46.stop();
2562
2432
  }
2563
- }, _callee49);
2433
+ }, _callee46);
2564
2434
  }));
2565
2435
  return function (_x5) {
2566
- return _ref50.apply(this, arguments);
2436
+ return _ref47.apply(this, arguments);
2567
2437
  };
2568
2438
  }());
2569
2439
  jest.runAllTimers();
2570
2440
  call.doHoldResume();
2571
- _context50.next = 9;
2441
+ _context47.next = 9;
2572
2442
  return (0, _testUtil.flushPromises)(2);
2573
2443
  case 9:
2574
2444
  /* At this point, the Call State should be S_CALL_HOLD
@@ -2581,11 +2451,11 @@ describe('Supplementary Services tests', function () {
2581
2451
  call['handleIncomingRoapOffer']({}, dummyEvent);
2582
2452
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2583
2453
  roapEvent.data.type = 'ANSWER';
2584
- _context50.next = 15;
2454
+ _context47.next = 15;
2585
2455
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2586
2456
  case 15:
2587
2457
  roapEvent.data.type = 'OK';
2588
- _context50.next = 18;
2458
+ _context47.next = 18;
2589
2459
  return call['handleRoapEstablished']({}, dummyEvent);
2590
2460
  case 18:
2591
2461
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2597,14 +2467,14 @@ describe('Supplementary Services tests', function () {
2597
2467
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2598
2468
  case 21:
2599
2469
  case "end":
2600
- return _context50.stop();
2470
+ return _context47.stop();
2601
2471
  }
2602
- }, _callee50);
2472
+ }, _callee47);
2603
2473
  })));
2604
- it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
2474
+ it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
2605
2475
  var responsePayload, warnSpy, roapEvent;
2606
- return _regenerator.default.wrap(function _callee52$(_context52) {
2607
- while (1) switch (_context52.prev = _context52.next) {
2476
+ return _regenerator.default.wrap(function _callee49$(_context49) {
2477
+ while (1) switch (_context49.prev = _context49.next) {
2608
2478
  case 0:
2609
2479
  expect.assertions(7);
2610
2480
  responsePayload = {
@@ -2617,25 +2487,25 @@ describe('Supplementary Services tests', function () {
2617
2487
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2618
2488
  call['held'] = true;
2619
2489
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
2620
- var _ref52 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(correlationId) {
2621
- return _regenerator.default.wrap(function _callee51$(_context51) {
2622
- while (1) switch (_context51.prev = _context51.next) {
2490
+ var _ref49 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(correlationId) {
2491
+ return _regenerator.default.wrap(function _callee48$(_context48) {
2492
+ while (1) switch (_context48.prev = _context48.next) {
2623
2493
  case 0:
2624
2494
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2625
2495
  case 1:
2626
2496
  case "end":
2627
- return _context51.stop();
2497
+ return _context48.stop();
2628
2498
  }
2629
- }, _callee51);
2499
+ }, _callee48);
2630
2500
  }));
2631
2501
  return function (_x6) {
2632
- return _ref52.apply(this, arguments);
2502
+ return _ref49.apply(this, arguments);
2633
2503
  };
2634
2504
  }());
2635
- _context52.next = 10;
2505
+ _context49.next = 10;
2636
2506
  return call.doHoldResume();
2637
2507
  case 10:
2638
- _context52.next = 12;
2508
+ _context49.next = 12;
2639
2509
  return (0, _testUtil.flushPromises)(2);
2640
2510
  case 12:
2641
2511
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2651,11 +2521,11 @@ describe('Supplementary Services tests', function () {
2651
2521
  call['handleIncomingRoapOffer']({}, dummyEvent);
2652
2522
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2653
2523
  roapEvent.data.type = 'ANSWER';
2654
- _context52.next = 20;
2524
+ _context49.next = 20;
2655
2525
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2656
2526
  case 20:
2657
2527
  roapEvent.data.type = 'OK';
2658
- _context52.next = 23;
2528
+ _context49.next = 23;
2659
2529
  return call['handleRoapEstablished']({}, dummyEvent);
2660
2530
  case 23:
2661
2531
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2670,14 +2540,14 @@ describe('Supplementary Services tests', function () {
2670
2540
  });
2671
2541
  case 28:
2672
2542
  case "end":
2673
- return _context52.stop();
2543
+ return _context49.stop();
2674
2544
  }
2675
- }, _callee52);
2545
+ }, _callee49);
2676
2546
  })));
2677
- it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
2547
+ it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
2678
2548
  var responsePayload, warnSpy, roapEvent;
2679
- return _regenerator.default.wrap(function _callee54$(_context54) {
2680
- while (1) switch (_context54.prev = _context54.next) {
2549
+ return _regenerator.default.wrap(function _callee51$(_context51) {
2550
+ while (1) switch (_context51.prev = _context51.next) {
2681
2551
  case 0:
2682
2552
  expect.assertions(7);
2683
2553
  responsePayload = {
@@ -2690,26 +2560,26 @@ describe('Supplementary Services tests', function () {
2690
2560
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2691
2561
  call['held'] = true;
2692
2562
  call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
2693
- var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(correlationId) {
2694
- return _regenerator.default.wrap(function _callee53$(_context53) {
2695
- while (1) switch (_context53.prev = _context53.next) {
2563
+ var _ref51 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50(correlationId) {
2564
+ return _regenerator.default.wrap(function _callee50$(_context50) {
2565
+ while (1) switch (_context50.prev = _context50.next) {
2696
2566
  case 0:
2697
2567
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2698
2568
  case 1:
2699
2569
  case "end":
2700
- return _context53.stop();
2570
+ return _context50.stop();
2701
2571
  }
2702
- }, _callee53);
2572
+ }, _callee50);
2703
2573
  }));
2704
2574
  return function (_x7) {
2705
- return _ref54.apply(this, arguments);
2575
+ return _ref51.apply(this, arguments);
2706
2576
  };
2707
2577
  }());
2708
2578
  call.doHoldResume();
2709
- _context54.next = 11;
2579
+ _context51.next = 11;
2710
2580
  return _promise.default.resolve();
2711
2581
  case 11:
2712
- _context54.next = 13;
2582
+ _context51.next = 13;
2713
2583
  return _promise.default.resolve();
2714
2584
  case 13:
2715
2585
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2725,11 +2595,11 @@ describe('Supplementary Services tests', function () {
2725
2595
  call['handleIncomingRoapOffer']({}, dummyEvent);
2726
2596
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2727
2597
  roapEvent.data.type = 'ANSWER';
2728
- _context54.next = 21;
2598
+ _context51.next = 21;
2729
2599
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2730
2600
  case 21:
2731
2601
  roapEvent.data.type = 'OK';
2732
- _context54.next = 24;
2602
+ _context51.next = 24;
2733
2603
  return call['handleRoapEstablished']({}, dummyEvent);
2734
2604
  case 24:
2735
2605
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2744,14 +2614,14 @@ describe('Supplementary Services tests', function () {
2744
2614
  });
2745
2615
  case 29:
2746
2616
  case "end":
2747
- return _context54.stop();
2617
+ return _context51.stop();
2748
2618
  }
2749
- }, _callee54);
2619
+ }, _callee51);
2750
2620
  })));
2751
- it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
2621
+ it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
2752
2622
  var responsePayload;
2753
- return _regenerator.default.wrap(function _callee56$(_context56) {
2754
- while (1) switch (_context56.prev = _context56.next) {
2623
+ return _regenerator.default.wrap(function _callee53$(_context53) {
2624
+ while (1) switch (_context53.prev = _context53.next) {
2755
2625
  case 0:
2756
2626
  expect.assertions(4);
2757
2627
  responsePayload = {
@@ -2761,26 +2631,26 @@ describe('Supplementary Services tests', function () {
2761
2631
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2762
2632
  call['held'] = true;
2763
2633
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
2764
- var _ref56 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(errObj) {
2765
- return _regenerator.default.wrap(function _callee55$(_context55) {
2766
- while (1) switch (_context55.prev = _context55.next) {
2634
+ var _ref53 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(errObj) {
2635
+ return _regenerator.default.wrap(function _callee52$(_context52) {
2636
+ while (1) switch (_context52.prev = _context52.next) {
2767
2637
  case 0:
2768
2638
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2769
2639
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2770
2640
  case 2:
2771
2641
  case "end":
2772
- return _context55.stop();
2642
+ return _context52.stop();
2773
2643
  }
2774
- }, _callee55);
2644
+ }, _callee52);
2775
2645
  }));
2776
2646
  return function (_x8) {
2777
- return _ref56.apply(this, arguments);
2647
+ return _ref53.apply(this, arguments);
2778
2648
  };
2779
2649
  }());
2780
- _context56.next = 7;
2650
+ _context53.next = 7;
2781
2651
  return call.doHoldResume();
2782
2652
  case 7:
2783
- _context56.next = 9;
2653
+ _context53.next = 9;
2784
2654
  return (0, _testUtil.flushPromises)(2);
2785
2655
  case 9:
2786
2656
  expect(call.isHeld()).toStrictEqual(true);
@@ -2791,14 +2661,14 @@ describe('Supplementary Services tests', function () {
2791
2661
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2792
2662
  case 11:
2793
2663
  case "end":
2794
- return _context56.stop();
2664
+ return _context53.stop();
2795
2665
  }
2796
- }, _callee56);
2666
+ }, _callee53);
2797
2667
  })));
2798
- it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
2668
+ it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
2799
2669
  var responsePayload, rejectPayload, roapEvent;
2800
- return _regenerator.default.wrap(function _callee58$(_context58) {
2801
- while (1) switch (_context58.prev = _context58.next) {
2670
+ return _regenerator.default.wrap(function _callee55$(_context55) {
2671
+ while (1) switch (_context55.prev = _context55.next) {
2802
2672
  case 0:
2803
2673
  expect.assertions(5);
2804
2674
  responsePayload = {
@@ -2812,24 +2682,24 @@ describe('Supplementary Services tests', function () {
2812
2682
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2813
2683
  call['held'] = true;
2814
2684
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
2815
- var _ref58 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(errObj) {
2816
- return _regenerator.default.wrap(function _callee57$(_context57) {
2817
- while (1) switch (_context57.prev = _context57.next) {
2685
+ var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
2686
+ return _regenerator.default.wrap(function _callee54$(_context54) {
2687
+ while (1) switch (_context54.prev = _context54.next) {
2818
2688
  case 0:
2819
2689
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2820
2690
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2821
2691
  case 2:
2822
2692
  case "end":
2823
- return _context57.stop();
2693
+ return _context54.stop();
2824
2694
  }
2825
- }, _callee57);
2695
+ }, _callee54);
2826
2696
  }));
2827
2697
  return function (_x9) {
2828
- return _ref58.apply(this, arguments);
2698
+ return _ref55.apply(this, arguments);
2829
2699
  };
2830
2700
  }());
2831
2701
  call.doHoldResume();
2832
- _context58.next = 9;
2702
+ _context55.next = 9;
2833
2703
  return (0, _testUtil.flushPromises)(2);
2834
2704
  case 9:
2835
2705
  /* At this point , the Call State should transition to S_CALL_ESTABLISHED
@@ -2840,7 +2710,7 @@ describe('Supplementary Services tests', function () {
2840
2710
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2841
2711
  /* We are intentionally failing the ROAP ANSWER */
2842
2712
  roapEvent.data.type = 'ANSWER';
2843
- _context58.next = 15;
2713
+ _context55.next = 15;
2844
2714
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2845
2715
  case 15:
2846
2716
  expect(call.isHeld()).toStrictEqual(true);
@@ -2848,14 +2718,14 @@ describe('Supplementary Services tests', function () {
2848
2718
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2849
2719
  case 17:
2850
2720
  case "end":
2851
- return _context58.stop();
2721
+ return _context55.stop();
2852
2722
  }
2853
- }, _callee58);
2723
+ }, _callee55);
2854
2724
  })));
2855
- it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
2725
+ it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
2856
2726
  var responsePayload, roapEvent;
2857
- return _regenerator.default.wrap(function _callee60$(_context60) {
2858
- while (1) switch (_context60.prev = _context60.next) {
2727
+ return _regenerator.default.wrap(function _callee57$(_context57) {
2728
+ while (1) switch (_context57.prev = _context57.next) {
2859
2729
  case 0:
2860
2730
  expect.assertions(5);
2861
2731
  responsePayload = {
@@ -2865,24 +2735,24 @@ describe('Supplementary Services tests', function () {
2865
2735
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2866
2736
  call['held'] = true;
2867
2737
  call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
2868
- var _ref60 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(errObj) {
2869
- return _regenerator.default.wrap(function _callee59$(_context59) {
2870
- while (1) switch (_context59.prev = _context59.next) {
2738
+ var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(errObj) {
2739
+ return _regenerator.default.wrap(function _callee56$(_context56) {
2740
+ while (1) switch (_context56.prev = _context56.next) {
2871
2741
  case 0:
2872
2742
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2873
2743
  expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
2874
2744
  case 2:
2875
2745
  case "end":
2876
- return _context59.stop();
2746
+ return _context56.stop();
2877
2747
  }
2878
- }, _callee59);
2748
+ }, _callee56);
2879
2749
  }));
2880
2750
  return function (_x10) {
2881
- return _ref60.apply(this, arguments);
2751
+ return _ref57.apply(this, arguments);
2882
2752
  };
2883
2753
  }());
2884
2754
  call.doHoldResume();
2885
- _context60.next = 8;
2755
+ _context57.next = 8;
2886
2756
  return (0, _testUtil.flushPromises)(2);
2887
2757
  case 8:
2888
2758
  /* At this point ,the Call State should be S_CALL_RESUME
@@ -2895,11 +2765,11 @@ describe('Supplementary Services tests', function () {
2895
2765
  call['handleIncomingRoapOffer']({}, dummyEvent);
2896
2766
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2897
2767
  roapEvent.data.type = 'ANSWER';
2898
- _context60.next = 14;
2768
+ _context57.next = 14;
2899
2769
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2900
2770
  case 14:
2901
2771
  roapEvent.data.type = 'OK';
2902
- _context60.next = 17;
2772
+ _context57.next = 17;
2903
2773
  return call['handleRoapEstablished']({}, dummyEvent);
2904
2774
  case 17:
2905
2775
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2909,9 +2779,9 @@ describe('Supplementary Services tests', function () {
2909
2779
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2910
2780
  case 20:
2911
2781
  case "end":
2912
- return _context60.stop();
2782
+ return _context57.stop();
2913
2783
  }
2914
- }, _callee60);
2784
+ }, _callee57);
2915
2785
  })));
2916
2786
  });
2917
2787
  describe('Call transfer tests', function () {
@@ -2933,20 +2803,20 @@ describe('Supplementary Services tests', function () {
2933
2803
  call['held'] = true;
2934
2804
 
2935
2805
  /* We will create a second call just like the first call, but call is active, i.e, not held */
2936
- secondCall = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2806
+ secondCall = new _call.Call(activeUrl, webex, transfereeDest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2937
2807
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2938
2808
  var dummy = 10;
2939
- }, defaultServiceIndicator, transfereeDest);
2809
+ }, defaultServiceIndicator);
2940
2810
  secondCall['connected'] = true;
2941
2811
  secondCall['earlyMedia'] = false;
2942
2812
  secondCall['callStateMachine'].state.value = 'S_CALL_ESTABLISHED';
2943
2813
  secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
2944
2814
  secondCall['held'] = false;
2945
2815
  });
2946
- it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63() {
2816
+ it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
2947
2817
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
2948
- return _regenerator.default.wrap(function _callee63$(_context63) {
2949
- while (1) switch (_context63.prev = _context63.next) {
2818
+ return _regenerator.default.wrap(function _callee60$(_context60) {
2819
+ while (1) switch (_context60.prev = _context60.next) {
2950
2820
  case 0:
2951
2821
  expect.assertions(9);
2952
2822
  responsePayload = {
@@ -2958,41 +2828,41 @@ describe('Supplementary Services tests', function () {
2958
2828
  infoSpy = jest.spyOn(_Logger.default, 'info');
2959
2829
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
2960
2830
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
2961
- var _ref62 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
2962
- return _regenerator.default.wrap(function _callee61$(_context61) {
2963
- while (1) switch (_context61.prev = _context61.next) {
2831
+ var _ref59 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(correlationId) {
2832
+ return _regenerator.default.wrap(function _callee58$(_context58) {
2833
+ while (1) switch (_context58.prev = _context58.next) {
2964
2834
  case 0:
2965
2835
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2966
2836
  case 1:
2967
2837
  case "end":
2968
- return _context61.stop();
2838
+ return _context58.stop();
2969
2839
  }
2970
- }, _callee61);
2840
+ }, _callee58);
2971
2841
  }));
2972
2842
  return function (_x11) {
2973
- return _ref62.apply(this, arguments);
2843
+ return _ref59.apply(this, arguments);
2974
2844
  };
2975
2845
  }());
2976
2846
  secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
2977
- var _ref63 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62(correlationId) {
2978
- return _regenerator.default.wrap(function _callee62$(_context62) {
2979
- while (1) switch (_context62.prev = _context62.next) {
2847
+ var _ref60 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(correlationId) {
2848
+ return _regenerator.default.wrap(function _callee59$(_context59) {
2849
+ while (1) switch (_context59.prev = _context59.next) {
2980
2850
  case 0:
2981
2851
  expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
2982
2852
  case 1:
2983
2853
  case "end":
2984
- return _context62.stop();
2854
+ return _context59.stop();
2985
2855
  }
2986
- }, _callee62);
2856
+ }, _callee59);
2987
2857
  }));
2988
2858
  return function (_x12) {
2989
- return _ref63.apply(this, arguments);
2859
+ return _ref60.apply(this, arguments);
2990
2860
  };
2991
2861
  }());
2992
- _context63.next = 10;
2862
+ _context60.next = 10;
2993
2863
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
2994
2864
  case 10:
2995
- _context63.next = 12;
2865
+ _context60.next = 12;
2996
2866
  return (0, _testUtil.flushPromises)(2);
2997
2867
  case 12:
2998
2868
  expect(requestSpy).toBeCalled();
@@ -3012,14 +2882,14 @@ describe('Supplementary Services tests', function () {
3012
2882
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3013
2883
  case 21:
3014
2884
  case "end":
3015
- return _context63.stop();
2885
+ return _context60.stop();
3016
2886
  }
3017
- }, _callee63);
2887
+ }, _callee60);
3018
2888
  })));
3019
- it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee65() {
2889
+ it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62() {
3020
2890
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
3021
- return _regenerator.default.wrap(function _callee65$(_context65) {
3022
- while (1) switch (_context65.prev = _context65.next) {
2891
+ return _regenerator.default.wrap(function _callee62$(_context62) {
2892
+ while (1) switch (_context62.prev = _context62.next) {
3023
2893
  case 0:
3024
2894
  expect.assertions(7);
3025
2895
  responsePayload = {
@@ -3031,25 +2901,25 @@ describe('Supplementary Services tests', function () {
3031
2901
  infoSpy = jest.spyOn(_Logger.default, 'info');
3032
2902
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3033
2903
  call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
3034
- var _ref65 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64(correlationId) {
3035
- return _regenerator.default.wrap(function _callee64$(_context64) {
3036
- while (1) switch (_context64.prev = _context64.next) {
2904
+ var _ref62 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
2905
+ return _regenerator.default.wrap(function _callee61$(_context61) {
2906
+ while (1) switch (_context61.prev = _context61.next) {
3037
2907
  case 0:
3038
2908
  expect(correlationId).toStrictEqual(call.getCorrelationId());
3039
2909
  case 1:
3040
2910
  case "end":
3041
- return _context64.stop();
2911
+ return _context61.stop();
3042
2912
  }
3043
- }, _callee64);
2913
+ }, _callee61);
3044
2914
  }));
3045
2915
  return function (_x13) {
3046
- return _ref65.apply(this, arguments);
2916
+ return _ref62.apply(this, arguments);
3047
2917
  };
3048
2918
  }());
3049
- _context65.next = 9;
2919
+ _context62.next = 9;
3050
2920
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3051
2921
  case 9:
3052
- _context65.next = 11;
2922
+ _context62.next = 11;
3053
2923
  return (0, _testUtil.flushPromises)(2);
3054
2924
  case 11:
3055
2925
  expect(requestSpy).toBeCalled();
@@ -3065,14 +2935,14 @@ describe('Supplementary Services tests', function () {
3065
2935
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
3066
2936
  case 18:
3067
2937
  case "end":
3068
- return _context65.stop();
2938
+ return _context62.stop();
3069
2939
  }
3070
- }, _callee65);
2940
+ }, _callee62);
3071
2941
  })));
3072
- it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee66() {
2942
+ it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63() {
3073
2943
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3074
- return _regenerator.default.wrap(function _callee66$(_context66) {
3075
- while (1) switch (_context66.prev = _context66.next) {
2944
+ return _regenerator.default.wrap(function _callee63$(_context63) {
2945
+ while (1) switch (_context63.prev = _context63.next) {
3076
2946
  case 0:
3077
2947
  responsePayload = {
3078
2948
  statusCode: 403,
@@ -3082,10 +2952,10 @@ describe('Supplementary Services tests', function () {
3082
2952
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3083
2953
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3084
2954
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3085
- _context66.next = 7;
2955
+ _context63.next = 7;
3086
2956
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
3087
2957
  case 7:
3088
- _context66.next = 9;
2958
+ _context63.next = 9;
3089
2959
  return (0, _testUtil.flushPromises)(1);
3090
2960
  case 9:
3091
2961
  expect(requestSpy).toBeCalled();
@@ -3101,14 +2971,14 @@ describe('Supplementary Services tests', function () {
3101
2971
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3102
2972
  case 16:
3103
2973
  case "end":
3104
- return _context66.stop();
2974
+ return _context63.stop();
3105
2975
  }
3106
- }, _callee66);
2976
+ }, _callee63);
3107
2977
  })));
3108
- it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee67() {
2978
+ it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64() {
3109
2979
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
3110
- return _regenerator.default.wrap(function _callee67$(_context67) {
3111
- while (1) switch (_context67.prev = _context67.next) {
2980
+ return _regenerator.default.wrap(function _callee64$(_context64) {
2981
+ while (1) switch (_context64.prev = _context64.next) {
3112
2982
  case 0:
3113
2983
  responsePayload = {
3114
2984
  statusCode: 403,
@@ -3118,10 +2988,10 @@ describe('Supplementary Services tests', function () {
3118
2988
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
3119
2989
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3120
2990
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
3121
- _context67.next = 7;
2991
+ _context64.next = 7;
3122
2992
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
3123
2993
  case 7:
3124
- _context67.next = 9;
2994
+ _context64.next = 9;
3125
2995
  return (0, _testUtil.flushPromises)(2);
3126
2996
  case 9:
3127
2997
  expect(requestSpy).toBeCalled();
@@ -3138,18 +3008,18 @@ describe('Supplementary Services tests', function () {
3138
3008
  expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
3139
3009
  case 17:
3140
3010
  case "end":
3141
- return _context67.stop();
3011
+ return _context64.stop();
3142
3012
  }
3143
- }, _callee67);
3013
+ }, _callee64);
3144
3014
  })));
3145
- it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee68() {
3015
+ it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee65() {
3146
3016
  var requestSpy, warnSpy;
3147
- return _regenerator.default.wrap(function _callee68$(_context68) {
3148
- while (1) switch (_context68.prev = _context68.next) {
3017
+ return _regenerator.default.wrap(function _callee65$(_context65) {
3018
+ while (1) switch (_context65.prev = _context65.next) {
3149
3019
  case 0:
3150
3020
  requestSpy = jest.spyOn(webex, 'request');
3151
3021
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3152
- _context68.next = 4;
3022
+ _context65.next = 4;
3153
3023
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
3154
3024
  case 4:
3155
3025
  /* We should be in CALL_ESTABLISHED state */
@@ -3160,18 +3030,18 @@ describe('Supplementary Services tests', function () {
3160
3030
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3161
3031
  case 9:
3162
3032
  case "end":
3163
- return _context68.stop();
3033
+ return _context65.stop();
3164
3034
  }
3165
- }, _callee68);
3035
+ }, _callee65);
3166
3036
  })));
3167
- it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee69() {
3037
+ it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee66() {
3168
3038
  var requestSpy, warnSpy;
3169
- return _regenerator.default.wrap(function _callee69$(_context69) {
3170
- while (1) switch (_context69.prev = _context69.next) {
3039
+ return _regenerator.default.wrap(function _callee66$(_context66) {
3040
+ while (1) switch (_context66.prev = _context66.next) {
3171
3041
  case 0:
3172
3042
  requestSpy = jest.spyOn(webex, 'request');
3173
3043
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3174
- _context69.next = 4;
3044
+ _context66.next = 4;
3175
3045
  return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
3176
3046
  case 4:
3177
3047
  /* We should be in CALL_ESTABLISHED state */
@@ -3182,9 +3052,9 @@ describe('Supplementary Services tests', function () {
3182
3052
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3183
3053
  case 9:
3184
3054
  case "end":
3185
- return _context69.stop();
3055
+ return _context66.stop();
3186
3056
  }
3187
- }, _callee69);
3057
+ }, _callee66);
3188
3058
  })));
3189
3059
  });
3190
3060
  });