@webex/calling 3.5.0 → 3.6.0

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