@webex/calling 3.5.0-next.18 → 3.5.0-next.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/CallingClient/CallingClient.js +2 -2
  2. package/dist/CallingClient/CallingClient.js.map +1 -1
  3. package/dist/CallingClient/CallingClient.test.js +1 -1
  4. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  5. package/dist/CallingClient/calling/call.js +25 -15
  6. package/dist/CallingClient/calling/call.js.map +1 -1
  7. package/dist/CallingClient/calling/call.test.js +430 -383
  8. package/dist/CallingClient/calling/call.test.js.map +1 -1
  9. package/dist/CallingClient/calling/callManager.js +6 -6
  10. package/dist/CallingClient/calling/callManager.js.map +1 -1
  11. package/dist/CallingClient/calling/callManager.test.js +3 -3
  12. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  13. package/dist/CallingClient/calling/types.js.map +1 -1
  14. package/dist/CallingClient/line/index.js +13 -6
  15. package/dist/CallingClient/line/index.js.map +1 -1
  16. package/dist/CallingClient/line/line.test.js +84 -22
  17. package/dist/CallingClient/line/line.test.js.map +1 -1
  18. package/dist/CallingClient/line/types.js.map +1 -1
  19. package/dist/CallingClient/registration/register.js +16 -5
  20. package/dist/CallingClient/registration/register.js.map +1 -1
  21. package/dist/CallingClient/types.js.map +1 -1
  22. package/dist/common/Utils.js +4 -2
  23. package/dist/common/Utils.js.map +1 -1
  24. package/dist/common/types.js +1 -0
  25. package/dist/common/types.js.map +1 -1
  26. package/dist/module/CallingClient/CallingClient.js +1 -1
  27. package/dist/module/CallingClient/calling/call.js +21 -16
  28. package/dist/module/CallingClient/calling/callManager.js +5 -5
  29. package/dist/module/CallingClient/line/index.js +12 -6
  30. package/dist/module/CallingClient/registration/register.js +5 -3
  31. package/dist/module/common/Utils.js +5 -2
  32. package/dist/module/common/types.js +1 -0
  33. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  34. package/dist/types/CallingClient/calling/call.d.ts +3 -3
  35. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  36. package/dist/types/CallingClient/calling/callManager.d.ts +1 -1
  37. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  38. package/dist/types/CallingClient/calling/types.d.ts +1 -1
  39. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  40. package/dist/types/CallingClient/line/index.d.ts +3 -2
  41. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  42. package/dist/types/CallingClient/line/types.d.ts +1 -1
  43. package/dist/types/CallingClient/line/types.d.ts.map +1 -1
  44. package/dist/types/CallingClient/registration/register.d.ts +3 -2
  45. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  46. package/dist/types/CallingClient/types.d.ts +1 -0
  47. package/dist/types/CallingClient/types.d.ts.map +1 -1
  48. package/dist/types/common/Utils.d.ts.map +1 -1
  49. package/dist/types/common/types.d.ts +2 -1
  50. package/dist/types/common/types.d.ts.map +1 -1
  51. package/package.json +2 -2
@@ -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,7 +345,7 @@ 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);
@@ -383,7 +383,7 @@ 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);
@@ -424,7 +424,7 @@ 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
430
  expect(mockInternalMediaCoreModule.RoapMediaConnection).toBeCalledOnceWith(roapMediaConnectionConfig, roapMediaConnectionOptions, expect.any(String));
@@ -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,53 @@ describe('Call Tests', function () {
625
625
  method: 'updateMedia'
626
626
  });
627
627
  });
628
+ describe('Guest Calling Flow Tests', function () {
629
+ var dummyEvent = {
630
+ type: 'E_SEND_CALL_SETUP',
631
+ data: undefined
632
+ };
633
+ var call;
634
+ it('outgoing call without guest calling must have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
635
+ var requestSpy, requestArgs;
636
+ return _regenerator.default.wrap(function _callee12$(_context12) {
637
+ while (1) switch (_context12.prev = _context12.next) {
638
+ case 0:
639
+ call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
640
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
641
+ var dummy = 10;
642
+ }, defaultServiceIndicator, dest);
643
+ call['callStateMachine'].state.value = 'S_IDLE';
644
+ requestSpy = jest.spyOn(webex, 'request');
645
+ call.sendCallStateMachineEvt(dummyEvent);
646
+ requestArgs = requestSpy.mock.calls[0][0];
647
+ expect('callee' in requestArgs.body).toBe(true);
648
+ case 6:
649
+ case "end":
650
+ return _context12.stop();
651
+ }
652
+ }, _callee12);
653
+ })));
654
+ it('outgoing call for guest calling must not have callee', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
655
+ var requestSpy, requestArgs;
656
+ return _regenerator.default.wrap(function _callee13$(_context13) {
657
+ while (1) switch (_context13.prev = _context13.next) {
658
+ case 0:
659
+ call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
660
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
661
+ var dummy = 10;
662
+ }, defaultServiceIndicator);
663
+ call['callStateMachine'].state.value = 'S_IDLE';
664
+ requestSpy = jest.spyOn(webex, 'request');
665
+ call.sendCallStateMachineEvt(dummyEvent);
666
+ requestArgs = requestSpy.mock.calls[0][0];
667
+ expect('callee' in requestArgs.body).toBe(false);
668
+ case 6:
669
+ case "end":
670
+ return _context13.stop();
671
+ }
672
+ }, _callee13);
673
+ })));
674
+ });
628
675
  });
629
676
  describe('State Machine handler tests', function () {
630
677
  var deviceId = '55dfb53f-bed2-36da-8e85-cee7f02aa68e';
@@ -642,10 +689,10 @@ describe('State Machine handler tests', function () {
642
689
  var call;
643
690
  var dtmfMock;
644
691
  beforeEach(function () {
645
- call = new _call.Call(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
692
+ call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
646
693
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
647
694
  var dummy = 10;
648
- }, defaultServiceIndicator);
695
+ }, defaultServiceIndicator, dest);
649
696
  jest.clearAllTimers();
650
697
  jest.useFakeTimers();
651
698
  call['callStateMachine'].state.value = 'S_IDLE';
@@ -655,10 +702,10 @@ describe('State Machine handler tests', function () {
655
702
 
656
703
  // afterEach(() => call.removeAllListeners());
657
704
 
658
- it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
705
+ it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
659
706
  var statusPayload, dummyEvent, funcSpy, logSpy;
660
- return _regenerator.default.wrap(function _callee12$(_context12) {
661
- while (1) switch (_context12.prev = _context12.next) {
707
+ return _regenerator.default.wrap(function _callee14$(_context14) {
708
+ while (1) switch (_context14.prev = _context14.next) {
662
709
  case 0:
663
710
  statusPayload = {
664
711
  statusCode: 200,
@@ -678,7 +725,7 @@ describe('State Machine handler tests', function () {
678
725
  /* This is to flush all the promises from the Promise queue so that
679
726
  * Jest.fakeTimers can advance time and also clear the promise Queue
680
727
  */
681
- _context12.next = 11;
728
+ _context14.next = 11;
682
729
  return (0, _testUtil.flushPromises)(3);
683
730
  case 11:
684
731
  expect(setInterval).toHaveBeenCalledTimes(1);
@@ -689,14 +736,14 @@ describe('State Machine handler tests', function () {
689
736
  });
690
737
  case 14:
691
738
  case "end":
692
- return _context12.stop();
739
+ return _context14.stop();
693
740
  }
694
- }, _callee12);
741
+ }, _callee14);
695
742
  })));
696
- it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
743
+ it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
697
744
  var statusPayload, funcSpy;
698
- return _regenerator.default.wrap(function _callee13$(_context13) {
699
- while (1) switch (_context13.prev = _context13.next) {
745
+ return _regenerator.default.wrap(function _callee15$(_context15) {
746
+ while (1) switch (_context15.prev = _context15.next) {
700
747
  case 0:
701
748
  expect.assertions(4);
702
749
  statusPayload = {
@@ -720,24 +767,24 @@ describe('State Machine handler tests', function () {
720
767
  /* This is to flush all the promises from the Promise queue so that
721
768
  * Jest.fakeTimers can advance time and also clear the promise Queue
722
769
  */
723
- _context13.next = 11;
770
+ _context15.next = 11;
724
771
  return _promise.default.resolve();
725
772
  case 11:
726
- _context13.next = 13;
773
+ _context15.next = 13;
727
774
  return _promise.default.resolve();
728
775
  case 13:
729
776
  expect(clearInterval).toHaveBeenCalledTimes(1);
730
777
  expect(funcSpy).toBeCalledTimes(1);
731
778
  case 15:
732
779
  case "end":
733
- return _context13.stop();
780
+ return _context15.stop();
734
781
  }
735
- }, _callee13);
782
+ }, _callee15);
736
783
  })));
737
- it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
784
+ it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
738
785
  var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
739
- return _regenerator.default.wrap(function _callee14$(_context14) {
740
- while (1) switch (_context14.prev = _context14.next) {
786
+ return _regenerator.default.wrap(function _callee16$(_context16) {
787
+ while (1) switch (_context16.prev = _context16.next) {
741
788
  case 0:
742
789
  statusPayload = {
743
790
  statusCode: 200,
@@ -793,14 +840,14 @@ describe('State Machine handler tests', function () {
793
840
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
794
841
  case 27:
795
842
  case "end":
796
- return _context14.stop();
843
+ return _context16.stop();
797
844
  }
798
- }, _callee14);
845
+ }, _callee16);
799
846
  })));
800
- it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
847
+ it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
801
848
  var statusPayload, dummyEvent;
802
- return _regenerator.default.wrap(function _callee15$(_context15) {
803
- while (1) switch (_context15.prev = _context15.next) {
849
+ return _regenerator.default.wrap(function _callee17$(_context17) {
850
+ while (1) switch (_context17.prev = _context17.next) {
804
851
  case 0:
805
852
  call['direction'] = _types3.CallDirection.INBOUND;
806
853
  statusPayload = {
@@ -818,7 +865,7 @@ describe('State Machine handler tests', function () {
818
865
  webex.request.mockReturnValue(statusPayload);
819
866
  call.sendCallStateMachineEvt(dummyEvent);
820
867
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
821
- _context15.next = 8;
868
+ _context17.next = 8;
822
869
  return call['handleOutgoingCallConnect']({
823
870
  type: 'E_SEND_CALL_CONNECT'
824
871
  });
@@ -832,14 +879,14 @@ describe('State Machine handler tests', function () {
832
879
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
833
880
  case 12:
834
881
  case "end":
835
- return _context15.stop();
882
+ return _context17.stop();
836
883
  }
837
- }, _callee15);
884
+ }, _callee17);
838
885
  })));
839
- it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
886
+ it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
840
887
  var warnSpy, stateMachineSpy, statusPayload, roapMessage;
841
- return _regenerator.default.wrap(function _callee16$(_context16) {
842
- while (1) switch (_context16.prev = _context16.next) {
888
+ return _regenerator.default.wrap(function _callee18$(_context18) {
889
+ while (1) switch (_context18.prev = _context18.next) {
843
890
  case 0:
844
891
  warnSpy = jest.spyOn(_Logger.default, 'warn');
845
892
  stateMachineSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
@@ -865,7 +912,7 @@ describe('State Machine handler tests', function () {
865
912
  webex.request.mockRejectedValueOnce({
866
913
  statusCode: 403
867
914
  }).mockResolvedValue(statusPayload);
868
- _context16.next = 12;
915
+ _context18.next = 12;
869
916
  return call['handleOutgoingCallConnect']({
870
917
  type: 'E_SEND_CALL_CONNECT'
871
918
  });
@@ -875,14 +922,14 @@ describe('State Machine handler tests', function () {
875
922
  expect(warnSpy).toBeCalledTimes(4);
876
923
  case 15:
877
924
  case "end":
878
- return _context16.stop();
925
+ return _context18.stop();
879
926
  }
880
- }, _callee16);
927
+ }, _callee18);
881
928
  })));
882
- it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
929
+ it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
883
930
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent;
884
- return _regenerator.default.wrap(function _callee17$(_context17) {
885
- while (1) switch (_context17.prev = _context17.next) {
931
+ return _regenerator.default.wrap(function _callee19$(_context19) {
932
+ while (1) switch (_context19.prev = _context19.next) {
886
933
  case 0:
887
934
  statusPayload = {
888
935
  statusCode: 200,
@@ -956,14 +1003,14 @@ describe('State Machine handler tests', function () {
956
1003
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
957
1004
  case 40:
958
1005
  case "end":
959
- return _context17.stop();
1006
+ return _context19.stop();
960
1007
  }
961
- }, _callee17);
1008
+ }, _callee19);
962
1009
  })));
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() {
1010
+ 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 _callee20() {
964
1011
  var statusPayload, dummySetupEvent, dummyConnectEvent, dummyOfferEvent, dummyAnswerEvent, dummyOkEvent, postMediaSpy;
965
- return _regenerator.default.wrap(function _callee18$(_context18) {
966
- while (1) switch (_context18.prev = _context18.next) {
1012
+ return _regenerator.default.wrap(function _callee20$(_context20) {
1013
+ while (1) switch (_context20.prev = _context20.next) {
967
1014
  case 0:
968
1015
  statusPayload = {
969
1016
  statusCode: 200,
@@ -1031,14 +1078,14 @@ describe('State Machine handler tests', function () {
1031
1078
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
1032
1079
  case 25:
1033
1080
  case "end":
1034
- return _context18.stop();
1081
+ return _context20.stop();
1035
1082
  }
1036
- }, _callee18);
1083
+ }, _callee20);
1037
1084
  })));
1038
- it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
1085
+ it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
1039
1086
  var statusPayload, dummyEvent;
1040
- return _regenerator.default.wrap(function _callee19$(_context19) {
1041
- while (1) switch (_context19.prev = _context19.next) {
1087
+ return _regenerator.default.wrap(function _callee21$(_context21) {
1088
+ while (1) switch (_context21.prev = _context21.next) {
1042
1089
  case 0:
1043
1090
  statusPayload = {
1044
1091
  statusCode: 200,
@@ -1077,14 +1124,14 @@ describe('State Machine handler tests', function () {
1077
1124
  expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
1078
1125
  case 17:
1079
1126
  case "end":
1080
- return _context19.stop();
1127
+ return _context21.stop();
1081
1128
  }
1082
- }, _callee19);
1129
+ }, _callee21);
1083
1130
  })));
1084
- it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
1131
+ it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
1085
1132
  var statusPayload, dummyEvent;
1086
- return _regenerator.default.wrap(function _callee20$(_context20) {
1087
- while (1) switch (_context20.prev = _context20.next) {
1133
+ return _regenerator.default.wrap(function _callee22$(_context22) {
1134
+ while (1) switch (_context22.prev = _context22.next) {
1088
1135
  case 0:
1089
1136
  statusPayload = {
1090
1137
  statusCode: 403,
@@ -1100,20 +1147,20 @@ describe('State Machine handler tests', function () {
1100
1147
  };
1101
1148
  webex.request.mockRejectedValueOnce(statusPayload);
1102
1149
  call.sendCallStateMachineEvt(dummyEvent);
1103
- _context20.next = 6;
1150
+ _context22.next = 6;
1104
1151
  return (0, _testUtil.flushPromises)(3);
1105
1152
  case 6:
1106
1153
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
1107
1154
  case 7:
1108
1155
  case "end":
1109
- return _context20.stop();
1156
+ return _context22.stop();
1110
1157
  }
1111
- }, _callee20);
1158
+ }, _callee22);
1112
1159
  })));
1113
- it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
1160
+ it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
1114
1161
  var statusPayload, dummyEvent;
1115
- return _regenerator.default.wrap(function _callee21$(_context21) {
1116
- while (1) switch (_context21.prev = _context21.next) {
1162
+ return _regenerator.default.wrap(function _callee23$(_context23) {
1163
+ while (1) switch (_context23.prev = _context23.next) {
1117
1164
  case 0:
1118
1165
  statusPayload = {
1119
1166
  statusCode: 403,
@@ -1130,10 +1177,10 @@ describe('State Machine handler tests', function () {
1130
1177
  call['earlyMedia'] = true;
1131
1178
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1132
1179
  webex.request.mockRejectedValue(statusPayload);
1133
- _context21.next = 8;
1180
+ _context23.next = 8;
1134
1181
  return call['handleRoapEstablished']({}, dummyEvent);
1135
1182
  case 8:
1136
- _context21.next = 10;
1183
+ _context23.next = 10;
1137
1184
  return (0, _testUtil.flushPromises)(2);
1138
1185
  case 10:
1139
1186
  expect(call.isConnected()).toBe(false);
@@ -1141,14 +1188,14 @@ describe('State Machine handler tests', function () {
1141
1188
  expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
1142
1189
  case 13:
1143
1190
  case "end":
1144
- return _context21.stop();
1191
+ return _context23.stop();
1145
1192
  }
1146
- }, _callee21);
1193
+ }, _callee23);
1147
1194
  })));
1148
- it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
1195
+ it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
1149
1196
  var statusPayload, dummyEvent;
1150
- return _regenerator.default.wrap(function _callee22$(_context22) {
1151
- while (1) switch (_context22.prev = _context22.next) {
1197
+ return _regenerator.default.wrap(function _callee24$(_context24) {
1198
+ while (1) switch (_context24.prev = _context24.next) {
1152
1199
  case 0:
1153
1200
  statusPayload = {
1154
1201
  statusCode: 403,
@@ -1171,14 +1218,14 @@ describe('State Machine handler tests', function () {
1171
1218
  expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
1172
1219
  case 8:
1173
1220
  case "end":
1174
- return _context22.stop();
1221
+ return _context24.stop();
1175
1222
  }
1176
- }, _callee22);
1223
+ }, _callee24);
1177
1224
  })));
1178
- it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
1225
+ it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
1179
1226
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1180
- return _regenerator.default.wrap(function _callee23$(_context23) {
1181
- while (1) switch (_context23.prev = _context23.next) {
1227
+ return _regenerator.default.wrap(function _callee25$(_context25) {
1228
+ while (1) switch (_context25.prev = _context25.next) {
1182
1229
  case 0:
1183
1230
  statusPayload = {
1184
1231
  statusCode: 503,
@@ -1200,7 +1247,7 @@ describe('State Machine handler tests', function () {
1200
1247
  }
1201
1248
  };
1202
1249
  call['connected'] = true;
1203
- _context23.next = 8;
1250
+ _context25.next = 8;
1204
1251
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1205
1252
  case 8:
1206
1253
  jest.advanceTimersByTime(1005);
@@ -1212,14 +1259,14 @@ describe('State Machine handler tests', function () {
1212
1259
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1213
1260
  case 13:
1214
1261
  case "end":
1215
- return _context23.stop();
1262
+ return _context25.stop();
1216
1263
  }
1217
- }, _callee23);
1264
+ }, _callee25);
1218
1265
  })));
1219
- it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
1266
+ it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
1220
1267
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1221
- return _regenerator.default.wrap(function _callee24$(_context24) {
1222
- while (1) switch (_context24.prev = _context24.next) {
1268
+ return _regenerator.default.wrap(function _callee26$(_context26) {
1269
+ while (1) switch (_context26.prev = _context26.next) {
1223
1270
  case 0:
1224
1271
  statusPayload = {
1225
1272
  statusCode: 503,
@@ -1241,7 +1288,7 @@ describe('State Machine handler tests', function () {
1241
1288
  }
1242
1289
  };
1243
1290
  call['connected'] = false;
1244
- _context24.next = 8;
1291
+ _context26.next = 8;
1245
1292
  return call['handleOutgoingRoapOffer']({}, dummyEvent);
1246
1293
  case 8:
1247
1294
  jest.advanceTimersByTime(1005);
@@ -1252,14 +1299,14 @@ describe('State Machine handler tests', function () {
1252
1299
  expect(stateMachineSpy).not.toBeCalled();
1253
1300
  case 12:
1254
1301
  case "end":
1255
- return _context24.stop();
1302
+ return _context26.stop();
1256
1303
  }
1257
- }, _callee24);
1304
+ }, _callee26);
1258
1305
  })));
1259
- it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
1306
+ it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
1260
1307
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1261
- return _regenerator.default.wrap(function _callee25$(_context25) {
1262
- while (1) switch (_context25.prev = _context25.next) {
1308
+ return _regenerator.default.wrap(function _callee27$(_context27) {
1309
+ while (1) switch (_context27.prev = _context27.next) {
1263
1310
  case 0:
1264
1311
  statusPayload = {
1265
1312
  statusCode: 503,
@@ -1281,7 +1328,7 @@ describe('State Machine handler tests', function () {
1281
1328
  };
1282
1329
  call['connected'] = true;
1283
1330
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
1284
- _context25.next = 9;
1331
+ _context27.next = 9;
1285
1332
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1286
1333
  case 9:
1287
1334
  jest.advanceTimersByTime(1005);
@@ -1293,14 +1340,14 @@ describe('State Machine handler tests', function () {
1293
1340
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1294
1341
  case 14:
1295
1342
  case "end":
1296
- return _context25.stop();
1343
+ return _context27.stop();
1297
1344
  }
1298
- }, _callee25);
1345
+ }, _callee27);
1299
1346
  })));
1300
- it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
1347
+ it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
1301
1348
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1302
- return _regenerator.default.wrap(function _callee26$(_context26) {
1303
- while (1) switch (_context26.prev = _context26.next) {
1349
+ return _regenerator.default.wrap(function _callee28$(_context28) {
1350
+ while (1) switch (_context28.prev = _context28.next) {
1304
1351
  case 0:
1305
1352
  statusPayload = {
1306
1353
  statusCode: 503,
@@ -1321,7 +1368,7 @@ describe('State Machine handler tests', function () {
1321
1368
  }
1322
1369
  };
1323
1370
  call['connected'] = false;
1324
- _context26.next = 8;
1371
+ _context28.next = 8;
1325
1372
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
1326
1373
  case 8:
1327
1374
  jest.advanceTimersByTime(1005);
@@ -1333,14 +1380,14 @@ describe('State Machine handler tests', function () {
1333
1380
  expect(stateMachineSpy).not.toBeCalled();
1334
1381
  case 13:
1335
1382
  case "end":
1336
- return _context26.stop();
1383
+ return _context28.stop();
1337
1384
  }
1338
- }, _callee26);
1385
+ }, _callee28);
1339
1386
  })));
1340
- it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
1387
+ it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
1341
1388
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1342
- return _regenerator.default.wrap(function _callee27$(_context27) {
1343
- while (1) switch (_context27.prev = _context27.next) {
1389
+ return _regenerator.default.wrap(function _callee29$(_context29) {
1390
+ while (1) switch (_context29.prev = _context29.next) {
1344
1391
  case 0:
1345
1392
  statusPayload = {
1346
1393
  statusCode: 200,
@@ -1365,14 +1412,14 @@ describe('State Machine handler tests', function () {
1365
1412
  expect(stateMachineSpy).not.toHaveBeenCalled();
1366
1413
  case 11:
1367
1414
  case "end":
1368
- return _context27.stop();
1415
+ return _context29.stop();
1369
1416
  }
1370
- }, _callee27);
1417
+ }, _callee29);
1371
1418
  })));
1372
- it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
1419
+ it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
1373
1420
  var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
1374
- return _regenerator.default.wrap(function _callee28$(_context28) {
1375
- while (1) switch (_context28.prev = _context28.next) {
1421
+ return _regenerator.default.wrap(function _callee30$(_context30) {
1422
+ while (1) switch (_context30.prev = _context30.next) {
1376
1423
  case 0:
1377
1424
  statusPayload = {
1378
1425
  statusCode: 503,
@@ -1394,7 +1441,7 @@ describe('State Machine handler tests', function () {
1394
1441
  };
1395
1442
  call['connected'] = true;
1396
1443
  call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
1397
- _context28.next = 9;
1444
+ _context30.next = 9;
1398
1445
  return call['handleRoapEstablished']({}, dummyEvent);
1399
1446
  case 9:
1400
1447
  jest.advanceTimersByTime(1005);
@@ -1406,14 +1453,14 @@ describe('State Machine handler tests', function () {
1406
1453
  expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
1407
1454
  case 14:
1408
1455
  case "end":
1409
- return _context28.stop();
1456
+ return _context30.stop();
1410
1457
  }
1411
- }, _callee28);
1458
+ }, _callee30);
1412
1459
  })));
1413
- it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
1460
+ it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
1414
1461
  var statusPayload, stateMachineSpy, funcSpy, errorEvent;
1415
- return _regenerator.default.wrap(function _callee29$(_context29) {
1416
- while (1) switch (_context29.prev = _context29.next) {
1462
+ return _regenerator.default.wrap(function _callee31$(_context31) {
1463
+ while (1) switch (_context31.prev = _context31.next) {
1417
1464
  case 0:
1418
1465
  statusPayload = {
1419
1466
  statusCode: 403,
@@ -1436,14 +1483,14 @@ describe('State Machine handler tests', function () {
1436
1483
  expect(stateMachineSpy).not.toHaveBeenCalled();
1437
1484
  case 9:
1438
1485
  case "end":
1439
- return _context29.stop();
1486
+ return _context31.stop();
1440
1487
  }
1441
- }, _callee29);
1488
+ }, _callee31);
1442
1489
  })));
1443
- it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
1490
+ it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
1444
1491
  var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
1445
- return _regenerator.default.wrap(function _callee30$(_context30) {
1446
- while (1) switch (_context30.prev = _context30.next) {
1492
+ return _regenerator.default.wrap(function _callee32$(_context32) {
1493
+ while (1) switch (_context32.prev = _context32.next) {
1447
1494
  case 0:
1448
1495
  statusPayload = {
1449
1496
  statusCode: 200,
@@ -1461,7 +1508,7 @@ describe('State Machine handler tests', function () {
1461
1508
  }
1462
1509
  };
1463
1510
  call['connected'] = false;
1464
- _context30.next = 8;
1511
+ _context32.next = 8;
1465
1512
  return call['handleRoapError']({}, errorEvent);
1466
1513
  case 8:
1467
1514
  expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
@@ -1477,14 +1524,14 @@ describe('State Machine handler tests', function () {
1477
1524
  });
1478
1525
  case 11:
1479
1526
  case "end":
1480
- return _context30.stop();
1527
+ return _context32.stop();
1481
1528
  }
1482
- }, _callee30);
1529
+ }, _callee32);
1483
1530
  })));
1484
- it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
1531
+ it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
1485
1532
  var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1486
- return _regenerator.default.wrap(function _callee31$(_context31) {
1487
- while (1) switch (_context31.prev = _context31.next) {
1533
+ return _regenerator.default.wrap(function _callee33$(_context33) {
1534
+ while (1) switch (_context33.prev = _context33.next) {
1488
1535
  case 0:
1489
1536
  statusPayload = {
1490
1537
  statusCode: 200,
@@ -1517,7 +1564,7 @@ describe('State Machine handler tests', function () {
1517
1564
  seq: 1,
1518
1565
  messageType: 'ANSWER'
1519
1566
  };
1520
- _context31.next = 17;
1567
+ _context33.next = 17;
1521
1568
  return call.sendMediaStateMachineEvt(dummyEvent);
1522
1569
  case 17:
1523
1570
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1539,7 +1586,7 @@ describe('State Machine handler tests', function () {
1539
1586
  seq: 2,
1540
1587
  messageType: 'OFFER_REQUEST'
1541
1588
  };
1542
- _context31.next = 23;
1589
+ _context33.next = 23;
1543
1590
  return call.sendMediaStateMachineEvt(dummyEvent);
1544
1591
  case 23:
1545
1592
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1589,7 +1636,7 @@ describe('State Machine handler tests', function () {
1589
1636
  };
1590
1637
  call.sendCallStateMachineEvt(dummyEvent);
1591
1638
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
1592
- _context31.next = 49;
1639
+ _context33.next = 49;
1593
1640
  return call.sendMediaStateMachineEvt(dummyEvent);
1594
1641
  case 49:
1595
1642
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1598,7 +1645,7 @@ describe('State Machine handler tests', function () {
1598
1645
  seq: 3,
1599
1646
  messageType: 'ANSWER'
1600
1647
  };
1601
- _context31.next = 54;
1648
+ _context33.next = 54;
1602
1649
  return call.sendMediaStateMachineEvt(dummyEvent);
1603
1650
  case 54:
1604
1651
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1617,7 +1664,7 @@ describe('State Machine handler tests', function () {
1617
1664
  messageType: 'OK'
1618
1665
  }
1619
1666
  };
1620
- _context31.next = 63;
1667
+ _context33.next = 63;
1621
1668
  return call.sendMediaStateMachineEvt(dummyOkEvent);
1622
1669
  case 63:
1623
1670
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
@@ -1632,14 +1679,14 @@ describe('State Machine handler tests', function () {
1632
1679
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
1633
1680
  case 70:
1634
1681
  case "end":
1635
- return _context31.stop();
1682
+ return _context33.stop();
1636
1683
  }
1637
- }, _callee31);
1684
+ }, _callee33);
1638
1685
  })));
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() {
1686
+ it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
1640
1687
  var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
1641
- return _regenerator.default.wrap(function _callee32$(_context32) {
1642
- while (1) switch (_context32.prev = _context32.next) {
1688
+ return _regenerator.default.wrap(function _callee34$(_context34) {
1689
+ while (1) switch (_context34.prev = _context34.next) {
1643
1690
  case 0:
1644
1691
  mockStatusBody = {
1645
1692
  device: {
@@ -1679,7 +1726,7 @@ describe('State Machine handler tests', function () {
1679
1726
  seq: 1,
1680
1727
  messageType: 'ANSWER'
1681
1728
  };
1682
- _context32.next = 18;
1729
+ _context34.next = 18;
1683
1730
  return call.sendMediaStateMachineEvt(dummyEvent);
1684
1731
  case 18:
1685
1732
  expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
@@ -1701,7 +1748,7 @@ describe('State Machine handler tests', function () {
1701
1748
  seq: 2,
1702
1749
  messageType: 'OFFER_REQUEST'
1703
1750
  };
1704
- _context32.next = 24;
1751
+ _context34.next = 24;
1705
1752
  return call.sendMediaStateMachineEvt(dummyEvent);
1706
1753
  case 24:
1707
1754
  expect(call['receivedRoapOKSeq']).toBe(0);
@@ -1751,7 +1798,7 @@ describe('State Machine handler tests', function () {
1751
1798
  };
1752
1799
  call.sendCallStateMachineEvt(dummyEvent);
1753
1800
  dummyEvent.type = 'E_RECV_ROAP_OFFER';
1754
- _context32.next = 50;
1801
+ _context34.next = 50;
1755
1802
  return call.sendMediaStateMachineEvt(dummyEvent);
1756
1803
  case 50:
1757
1804
  expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1760,7 +1807,7 @@ describe('State Machine handler tests', function () {
1760
1807
  seq: 3,
1761
1808
  messageType: 'ANSWER'
1762
1809
  };
1763
- _context32.next = 55;
1810
+ _context34.next = 55;
1764
1811
  return call.sendMediaStateMachineEvt(dummyEvent);
1765
1812
  case 55:
1766
1813
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
@@ -1777,7 +1824,7 @@ describe('State Machine handler tests', function () {
1777
1824
  }
1778
1825
  };
1779
1826
  call.sendMediaStateMachineEvt(dummyEvent);
1780
- _context32.next = 62;
1827
+ _context34.next = 62;
1781
1828
  return call.sendMediaStateMachineEvt(dummyOkEvent);
1782
1829
  case 62:
1783
1830
  expect(call['receivedRoapOKSeq']).toBe(3);
@@ -1793,14 +1840,14 @@ describe('State Machine handler tests', function () {
1793
1840
  expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
1794
1841
  case 70:
1795
1842
  case "end":
1796
- return _context32.stop();
1843
+ return _context34.stop();
1797
1844
  }
1798
- }, _callee32);
1845
+ }, _callee34);
1799
1846
  })));
1800
- it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
1847
+ it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
1801
1848
  var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
1802
- return _regenerator.default.wrap(function _callee33$(_context33) {
1803
- while (1) switch (_context33.prev = _context33.next) {
1849
+ return _regenerator.default.wrap(function _callee35$(_context35) {
1850
+ while (1) switch (_context35.prev = _context35.next) {
1804
1851
  case 0:
1805
1852
  statusPayload = {
1806
1853
  statusCode: 200,
@@ -1867,9 +1914,9 @@ describe('State Machine handler tests', function () {
1867
1914
  });
1868
1915
  case 33:
1869
1916
  case "end":
1870
- return _context33.stop();
1917
+ return _context35.stop();
1871
1918
  }
1872
- }, _callee33);
1919
+ }, _callee35);
1873
1920
  })));
1874
1921
  describe('Call event timers tests', function () {
1875
1922
  var callManager;
@@ -1880,10 +1927,10 @@ describe('State Machine handler tests', function () {
1880
1927
  afterEach(function () {
1881
1928
  jest.clearAllTimers();
1882
1929
  });
1883
- it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
1930
+ it('times out if the next event is not received - 60 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
1884
1931
  var statusPayload, dummyEvent, logSpy, emitSpy, deleteSpy, dummyOkEvent;
1885
- return _regenerator.default.wrap(function _callee34$(_context34) {
1886
- while (1) switch (_context34.prev = _context34.next) {
1932
+ return _regenerator.default.wrap(function _callee36$(_context36) {
1933
+ while (1) switch (_context36.prev = _context36.next) {
1887
1934
  case 0:
1888
1935
  statusPayload = {
1889
1936
  statusCode: 200,
@@ -1900,7 +1947,7 @@ describe('State Machine handler tests', function () {
1900
1947
  webex.request.mockReturnValue(statusPayload);
1901
1948
 
1902
1949
  // handleOutgoingCallSetup is asynchronous
1903
- _context34.next = 9;
1950
+ _context36.next = 9;
1904
1951
  return call.sendCallStateMachineEvt(dummyEvent);
1905
1952
  case 9:
1906
1953
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -1943,14 +1990,14 @@ describe('State Machine handler tests', function () {
1943
1990
  expect(callManager.callCollection).toStrictEqual({});
1944
1991
  case 32:
1945
1992
  case "end":
1946
- return _context34.stop();
1993
+ return _context36.stop();
1947
1994
  }
1948
- }, _callee34);
1995
+ }, _callee36);
1949
1996
  })));
1950
- it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35() {
1997
+ it('times out if the next event is not received - 10 seconds timeout', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
1951
1998
  var statusPayload, dummyEvent, call, emitSpy, deleteSpy, logSpy;
1952
- return _regenerator.default.wrap(function _callee35$(_context35) {
1953
- while (1) switch (_context35.prev = _context35.next) {
1999
+ return _regenerator.default.wrap(function _callee37$(_context37) {
2000
+ while (1) switch (_context37.prev = _context37.next) {
1954
2001
  case 0:
1955
2002
  statusPayload = {
1956
2003
  statusCode: 200,
@@ -1969,7 +2016,7 @@ describe('State Machine handler tests', function () {
1969
2016
  expect((0, _keys.default)(callManager.callCollection)[0]).toBe(call.getCorrelationId());
1970
2017
 
1971
2018
  // handleOutgoingCallSetup is asynchronous
1972
- _context35.next = 11;
2019
+ _context37.next = 11;
1973
2020
  return call.sendCallStateMachineEvt(dummyEvent);
1974
2021
  case 11:
1975
2022
  expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_SETUP');
@@ -1981,9 +2028,9 @@ describe('State Machine handler tests', function () {
1981
2028
  expect(callManager.callCollection).toStrictEqual({});
1982
2029
  case 18:
1983
2030
  case "end":
1984
- return _context35.stop();
2031
+ return _context37.stop();
1985
2032
  }
1986
- }, _callee35);
2033
+ }, _callee37);
1987
2034
  })));
1988
2035
  });
1989
2036
  });
@@ -2006,10 +2053,10 @@ describe('Supplementary Services tests', function () {
2006
2053
  * parameters manually
2007
2054
  */
2008
2055
 
2009
- call = new _call.Call(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2056
+ call = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2010
2057
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2011
2058
  var dummy = 10;
2012
- }, defaultServiceIndicator);
2059
+ }, defaultServiceIndicator, dest);
2013
2060
  call['connected'] = true;
2014
2061
  call['earlyMedia'] = false;
2015
2062
 
@@ -2043,10 +2090,10 @@ describe('Supplementary Services tests', function () {
2043
2090
  beforeEach(function () {
2044
2091
  call.removeAllListeners();
2045
2092
  });
2046
- it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
2093
+ it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
2047
2094
  var responsePayload, warnSpy, roapEvent;
2048
- return _regenerator.default.wrap(function _callee37$(_context37) {
2049
- while (1) switch (_context37.prev = _context37.next) {
2095
+ return _regenerator.default.wrap(function _callee39$(_context39) {
2096
+ while (1) switch (_context39.prev = _context39.next) {
2050
2097
  case 0:
2051
2098
  expect.assertions(7);
2052
2099
  responsePayload = {
@@ -2059,25 +2106,25 @@ describe('Supplementary Services tests', function () {
2059
2106
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2060
2107
  call['held'] = false;
2061
2108
  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) {
2109
+ var _ref39 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38(correlationId) {
2110
+ return _regenerator.default.wrap(function _callee38$(_context38) {
2111
+ while (1) switch (_context38.prev = _context38.next) {
2065
2112
  case 0:
2066
2113
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2067
2114
  case 1:
2068
2115
  case "end":
2069
- return _context36.stop();
2116
+ return _context38.stop();
2070
2117
  }
2071
- }, _callee36);
2118
+ }, _callee38);
2072
2119
  }));
2073
2120
  return function (_x) {
2074
- return _ref37.apply(this, arguments);
2121
+ return _ref39.apply(this, arguments);
2075
2122
  };
2076
2123
  }());
2077
- _context37.next = 10;
2124
+ _context39.next = 10;
2078
2125
  return call.doHoldResume();
2079
2126
  case 10:
2080
- _context37.next = 12;
2127
+ _context39.next = 12;
2081
2128
  return (0, _testUtil.flushPromises)(2);
2082
2129
  case 12:
2083
2130
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2093,11 +2140,11 @@ describe('Supplementary Services tests', function () {
2093
2140
  call['handleIncomingRoapOffer']({}, dummyEvent);
2094
2141
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2095
2142
  roapEvent.data.type = 'ANSWER';
2096
- _context37.next = 20;
2143
+ _context39.next = 20;
2097
2144
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2098
2145
  case 20:
2099
2146
  roapEvent.data.type = 'OK';
2100
- _context37.next = 23;
2147
+ _context39.next = 23;
2101
2148
  return call['handleRoapEstablished']({}, dummyEvent);
2102
2149
  case 23:
2103
2150
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2112,14 +2159,14 @@ describe('Supplementary Services tests', function () {
2112
2159
  });
2113
2160
  case 28:
2114
2161
  case "end":
2115
- return _context37.stop();
2162
+ return _context39.stop();
2116
2163
  }
2117
- }, _callee37);
2164
+ }, _callee39);
2118
2165
  })));
2119
- it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
2166
+ it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
2120
2167
  var responsePayload, warnSpy, roapEvent;
2121
- return _regenerator.default.wrap(function _callee39$(_context39) {
2122
- while (1) switch (_context39.prev = _context39.next) {
2168
+ return _regenerator.default.wrap(function _callee41$(_context41) {
2169
+ while (1) switch (_context41.prev = _context41.next) {
2123
2170
  case 0:
2124
2171
  expect.assertions(8);
2125
2172
  responsePayload = {
@@ -2132,26 +2179,26 @@ describe('Supplementary Services tests', function () {
2132
2179
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2133
2180
  call['held'] = false;
2134
2181
  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) {
2182
+ var _ref41 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(correlationId) {
2183
+ return _regenerator.default.wrap(function _callee40$(_context40) {
2184
+ while (1) switch (_context40.prev = _context40.next) {
2138
2185
  case 0:
2139
2186
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2140
2187
  case 1:
2141
2188
  case "end":
2142
- return _context38.stop();
2189
+ return _context40.stop();
2143
2190
  }
2144
- }, _callee38);
2191
+ }, _callee40);
2145
2192
  }));
2146
2193
  return function (_x2) {
2147
- return _ref39.apply(this, arguments);
2194
+ return _ref41.apply(this, arguments);
2148
2195
  };
2149
2196
  }());
2150
2197
  call.doHoldResume();
2151
- _context39.next = 11;
2198
+ _context41.next = 11;
2152
2199
  return _promise.default.resolve();
2153
2200
  case 11:
2154
- _context39.next = 13;
2201
+ _context41.next = 13;
2155
2202
  return _promise.default.resolve();
2156
2203
  case 13:
2157
2204
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2167,11 +2214,11 @@ describe('Supplementary Services tests', function () {
2167
2214
  call['handleIncomingRoapOffer']({}, dummyEvent);
2168
2215
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2169
2216
  roapEvent.data.type = 'ANSWER';
2170
- _context39.next = 22;
2217
+ _context41.next = 22;
2171
2218
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2172
2219
  case 22:
2173
2220
  roapEvent.data.type = 'OK';
2174
- _context39.next = 25;
2221
+ _context41.next = 25;
2175
2222
  return call['handleRoapEstablished']({}, dummyEvent);
2176
2223
  case 25:
2177
2224
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2186,14 +2233,14 @@ describe('Supplementary Services tests', function () {
2186
2233
  });
2187
2234
  case 30:
2188
2235
  case "end":
2189
- return _context39.stop();
2236
+ return _context41.stop();
2190
2237
  }
2191
- }, _callee39);
2238
+ }, _callee41);
2192
2239
  })));
2193
- it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41() {
2240
+ it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
2194
2241
  var responsePayload;
2195
- return _regenerator.default.wrap(function _callee41$(_context41) {
2196
- while (1) switch (_context41.prev = _context41.next) {
2242
+ return _regenerator.default.wrap(function _callee43$(_context43) {
2243
+ while (1) switch (_context43.prev = _context43.next) {
2197
2244
  case 0:
2198
2245
  expect.assertions(4);
2199
2246
  responsePayload = {
@@ -2203,26 +2250,26 @@ describe('Supplementary Services tests', function () {
2203
2250
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2204
2251
  call['held'] = false;
2205
2252
  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) {
2253
+ var _ref43 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(errObj) {
2254
+ return _regenerator.default.wrap(function _callee42$(_context42) {
2255
+ while (1) switch (_context42.prev = _context42.next) {
2209
2256
  case 0:
2210
2257
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2211
2258
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2212
2259
  case 2:
2213
2260
  case "end":
2214
- return _context40.stop();
2261
+ return _context42.stop();
2215
2262
  }
2216
- }, _callee40);
2263
+ }, _callee42);
2217
2264
  }));
2218
2265
  return function (_x3) {
2219
- return _ref41.apply(this, arguments);
2266
+ return _ref43.apply(this, arguments);
2220
2267
  };
2221
2268
  }());
2222
- _context41.next = 7;
2269
+ _context43.next = 7;
2223
2270
  return call.doHoldResume();
2224
2271
  case 7:
2225
- _context41.next = 9;
2272
+ _context43.next = 9;
2226
2273
  return (0, _testUtil.flushPromises)(2);
2227
2274
  case 9:
2228
2275
  expect(call.isHeld()).toStrictEqual(false);
@@ -2232,14 +2279,14 @@ describe('Supplementary Services tests', function () {
2232
2279
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2233
2280
  case 11:
2234
2281
  case "end":
2235
- return _context41.stop();
2282
+ return _context43.stop();
2236
2283
  }
2237
- }, _callee41);
2284
+ }, _callee43);
2238
2285
  })));
2239
- it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
2286
+ it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
2240
2287
  var responsePayload, rejectPayload, roapEvent;
2241
- return _regenerator.default.wrap(function _callee43$(_context43) {
2242
- while (1) switch (_context43.prev = _context43.next) {
2288
+ return _regenerator.default.wrap(function _callee45$(_context45) {
2289
+ while (1) switch (_context45.prev = _context45.next) {
2243
2290
  case 0:
2244
2291
  expect.assertions(5);
2245
2292
  responsePayload = {
@@ -2253,24 +2300,24 @@ describe('Supplementary Services tests', function () {
2253
2300
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2254
2301
  call['held'] = false;
2255
2302
  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) {
2303
+ var _ref45 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(errObj) {
2304
+ return _regenerator.default.wrap(function _callee44$(_context44) {
2305
+ while (1) switch (_context44.prev = _context44.next) {
2259
2306
  case 0:
2260
2307
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2261
2308
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2262
2309
  case 2:
2263
2310
  case "end":
2264
- return _context42.stop();
2311
+ return _context44.stop();
2265
2312
  }
2266
- }, _callee42);
2313
+ }, _callee44);
2267
2314
  }));
2268
2315
  return function (_x4) {
2269
- return _ref43.apply(this, arguments);
2316
+ return _ref45.apply(this, arguments);
2270
2317
  };
2271
2318
  }());
2272
2319
  call.doHoldResume();
2273
- _context43.next = 9;
2320
+ _context45.next = 9;
2274
2321
  return (0, _testUtil.flushPromises)(2);
2275
2322
  case 9:
2276
2323
  /* the Call State should transition to S_CALL_ESTABLISHED
@@ -2280,7 +2327,7 @@ describe('Supplementary Services tests', function () {
2280
2327
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2281
2328
  /* We are intentionally failing the ROAP ANSWER */
2282
2329
  roapEvent.data.type = 'ANSWER';
2283
- _context43.next = 15;
2330
+ _context45.next = 15;
2284
2331
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2285
2332
  case 15:
2286
2333
  expect(call.isHeld()).toStrictEqual(false);
@@ -2288,14 +2335,14 @@ describe('Supplementary Services tests', function () {
2288
2335
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2289
2336
  case 17:
2290
2337
  case "end":
2291
- return _context43.stop();
2338
+ return _context45.stop();
2292
2339
  }
2293
- }, _callee43);
2340
+ }, _callee45);
2294
2341
  })));
2295
- it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
2342
+ it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
2296
2343
  var responsePayload, warnSpy, roapEvent;
2297
- return _regenerator.default.wrap(function _callee44$(_context44) {
2298
- while (1) switch (_context44.prev = _context44.next) {
2344
+ return _regenerator.default.wrap(function _callee46$(_context46) {
2345
+ while (1) switch (_context46.prev = _context46.next) {
2299
2346
  case 0:
2300
2347
  responsePayload = {
2301
2348
  statusCode: 200,
@@ -2306,10 +2353,10 @@ describe('Supplementary Services tests', function () {
2306
2353
  jest.spyOn(global, 'clearTimeout');
2307
2354
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2308
2355
  call['held'] = false;
2309
- _context44.next = 8;
2356
+ _context46.next = 8;
2310
2357
  return call.doHoldResume();
2311
2358
  case 8:
2312
- _context44.next = 10;
2359
+ _context46.next = 10;
2313
2360
  return (0, _testUtil.flushPromises)(2);
2314
2361
  case 10:
2315
2362
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2324,19 +2371,19 @@ describe('Supplementary Services tests', function () {
2324
2371
  call['handleIncomingRoapOffer']({}, dummyEvent);
2325
2372
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2326
2373
  roapEvent.data.type = 'ANSWER';
2327
- _context44.next = 17;
2374
+ _context46.next = 17;
2328
2375
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2329
2376
  case 17:
2330
2377
  jest.spyOn(webex, 'request').mockRejectedValue({
2331
2378
  statusCode: 403
2332
2379
  });
2333
2380
  roapEvent.data.type = 'OK';
2334
- _context44.next = 21;
2381
+ _context46.next = 21;
2335
2382
  return call['handleRoapEstablished']({}, dummyEvent);
2336
2383
  case 21:
2337
2384
  /* this is for coverage */
2338
2385
  call['callStateMachine'].state.value = 'S_CALL_HOLD';
2339
- _context44.next = 24;
2386
+ _context46.next = 24;
2340
2387
  return call['handleRoapEstablished']({}, dummyEvent);
2341
2388
  case 24:
2342
2389
  expect(call.isHeld()).toStrictEqual(false);
@@ -2348,14 +2395,14 @@ describe('Supplementary Services tests', function () {
2348
2395
  });
2349
2396
  case 27:
2350
2397
  case "end":
2351
- return _context44.stop();
2398
+ return _context46.stop();
2352
2399
  }
2353
- }, _callee44);
2400
+ }, _callee46);
2354
2401
  })));
2355
- it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
2402
+ it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
2356
2403
  var responsePayload, warnSpy, roapEvent;
2357
- return _regenerator.default.wrap(function _callee45$(_context45) {
2358
- while (1) switch (_context45.prev = _context45.next) {
2404
+ return _regenerator.default.wrap(function _callee47$(_context47) {
2405
+ while (1) switch (_context47.prev = _context47.next) {
2359
2406
  case 0:
2360
2407
  responsePayload = {
2361
2408
  statusCode: 200,
@@ -2366,10 +2413,10 @@ describe('Supplementary Services tests', function () {
2366
2413
  jest.spyOn(global, 'clearTimeout');
2367
2414
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2368
2415
  call['held'] = true;
2369
- _context45.next = 8;
2416
+ _context47.next = 8;
2370
2417
  return call.doHoldResume();
2371
2418
  case 8:
2372
- _context45.next = 10;
2419
+ _context47.next = 10;
2373
2420
  return (0, _testUtil.flushPromises)(2);
2374
2421
  case 10:
2375
2422
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2384,14 +2431,14 @@ describe('Supplementary Services tests', function () {
2384
2431
  call['handleIncomingRoapOffer']({}, dummyEvent);
2385
2432
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2386
2433
  roapEvent.data.type = 'ANSWER';
2387
- _context45.next = 17;
2434
+ _context47.next = 17;
2388
2435
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2389
2436
  case 17:
2390
2437
  jest.spyOn(webex, 'request').mockRejectedValue({
2391
2438
  statusCode: 403
2392
2439
  });
2393
2440
  roapEvent.data.type = 'OK';
2394
- _context45.next = 21;
2441
+ _context47.next = 21;
2395
2442
  return call['handleRoapEstablished']({}, dummyEvent);
2396
2443
  case 21:
2397
2444
  expect(call.isHeld()).toStrictEqual(true);
@@ -2403,14 +2450,14 @@ describe('Supplementary Services tests', function () {
2403
2450
  });
2404
2451
  case 24:
2405
2452
  case "end":
2406
- return _context45.stop();
2453
+ return _context47.stop();
2407
2454
  }
2408
- }, _callee45);
2455
+ }, _callee47);
2409
2456
  })));
2410
- it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
2457
+ it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
2411
2458
  var responsePayload, roapEvent;
2412
- return _regenerator.default.wrap(function _callee47$(_context47) {
2413
- while (1) switch (_context47.prev = _context47.next) {
2459
+ return _regenerator.default.wrap(function _callee49$(_context49) {
2460
+ while (1) switch (_context49.prev = _context49.next) {
2414
2461
  case 0:
2415
2462
  expect.assertions(5);
2416
2463
  responsePayload = {
@@ -2420,25 +2467,25 @@ describe('Supplementary Services tests', function () {
2420
2467
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2421
2468
  call['held'] = false;
2422
2469
  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) {
2470
+ var _ref49 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(errObj) {
2471
+ return _regenerator.default.wrap(function _callee48$(_context48) {
2472
+ while (1) switch (_context48.prev = _context48.next) {
2426
2473
  case 0:
2427
2474
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2428
2475
  expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
2429
2476
  case 2:
2430
2477
  case "end":
2431
- return _context46.stop();
2478
+ return _context48.stop();
2432
2479
  }
2433
- }, _callee46);
2480
+ }, _callee48);
2434
2481
  }));
2435
2482
  return function (_x5) {
2436
- return _ref47.apply(this, arguments);
2483
+ return _ref49.apply(this, arguments);
2437
2484
  };
2438
2485
  }());
2439
2486
  jest.runAllTimers();
2440
2487
  call.doHoldResume();
2441
- _context47.next = 9;
2488
+ _context49.next = 9;
2442
2489
  return (0, _testUtil.flushPromises)(2);
2443
2490
  case 9:
2444
2491
  /* At this point, the Call State should be S_CALL_HOLD
@@ -2451,11 +2498,11 @@ describe('Supplementary Services tests', function () {
2451
2498
  call['handleIncomingRoapOffer']({}, dummyEvent);
2452
2499
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2453
2500
  roapEvent.data.type = 'ANSWER';
2454
- _context47.next = 15;
2501
+ _context49.next = 15;
2455
2502
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2456
2503
  case 15:
2457
2504
  roapEvent.data.type = 'OK';
2458
- _context47.next = 18;
2505
+ _context49.next = 18;
2459
2506
  return call['handleRoapEstablished']({}, dummyEvent);
2460
2507
  case 18:
2461
2508
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2467,14 +2514,14 @@ describe('Supplementary Services tests', function () {
2467
2514
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2468
2515
  case 21:
2469
2516
  case "end":
2470
- return _context47.stop();
2517
+ return _context49.stop();
2471
2518
  }
2472
- }, _callee47);
2519
+ }, _callee49);
2473
2520
  })));
2474
- it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
2521
+ it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
2475
2522
  var responsePayload, warnSpy, roapEvent;
2476
- return _regenerator.default.wrap(function _callee49$(_context49) {
2477
- while (1) switch (_context49.prev = _context49.next) {
2523
+ return _regenerator.default.wrap(function _callee51$(_context51) {
2524
+ while (1) switch (_context51.prev = _context51.next) {
2478
2525
  case 0:
2479
2526
  expect.assertions(7);
2480
2527
  responsePayload = {
@@ -2487,25 +2534,25 @@ describe('Supplementary Services tests', function () {
2487
2534
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2488
2535
  call['held'] = true;
2489
2536
  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) {
2537
+ var _ref51 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50(correlationId) {
2538
+ return _regenerator.default.wrap(function _callee50$(_context50) {
2539
+ while (1) switch (_context50.prev = _context50.next) {
2493
2540
  case 0:
2494
2541
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2495
2542
  case 1:
2496
2543
  case "end":
2497
- return _context48.stop();
2544
+ return _context50.stop();
2498
2545
  }
2499
- }, _callee48);
2546
+ }, _callee50);
2500
2547
  }));
2501
2548
  return function (_x6) {
2502
- return _ref49.apply(this, arguments);
2549
+ return _ref51.apply(this, arguments);
2503
2550
  };
2504
2551
  }());
2505
- _context49.next = 10;
2552
+ _context51.next = 10;
2506
2553
  return call.doHoldResume();
2507
2554
  case 10:
2508
- _context49.next = 12;
2555
+ _context51.next = 12;
2509
2556
  return (0, _testUtil.flushPromises)(2);
2510
2557
  case 12:
2511
2558
  expect(setTimeout).toHaveBeenCalledTimes(1);
@@ -2521,11 +2568,11 @@ describe('Supplementary Services tests', function () {
2521
2568
  call['handleIncomingRoapOffer']({}, dummyEvent);
2522
2569
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2523
2570
  roapEvent.data.type = 'ANSWER';
2524
- _context49.next = 20;
2571
+ _context51.next = 20;
2525
2572
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2526
2573
  case 20:
2527
2574
  roapEvent.data.type = 'OK';
2528
- _context49.next = 23;
2575
+ _context51.next = 23;
2529
2576
  return call['handleRoapEstablished']({}, dummyEvent);
2530
2577
  case 23:
2531
2578
  expect(clearTimeout).toHaveBeenCalledTimes(1);
@@ -2540,14 +2587,14 @@ describe('Supplementary Services tests', function () {
2540
2587
  });
2541
2588
  case 28:
2542
2589
  case "end":
2543
- return _context49.stop();
2590
+ return _context51.stop();
2544
2591
  }
2545
- }, _callee49);
2592
+ }, _callee51);
2546
2593
  })));
2547
- it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
2594
+ it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
2548
2595
  var responsePayload, warnSpy, roapEvent;
2549
- return _regenerator.default.wrap(function _callee51$(_context51) {
2550
- while (1) switch (_context51.prev = _context51.next) {
2596
+ return _regenerator.default.wrap(function _callee53$(_context53) {
2597
+ while (1) switch (_context53.prev = _context53.next) {
2551
2598
  case 0:
2552
2599
  expect.assertions(7);
2553
2600
  responsePayload = {
@@ -2560,26 +2607,26 @@ describe('Supplementary Services tests', function () {
2560
2607
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2561
2608
  call['held'] = true;
2562
2609
  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) {
2610
+ var _ref53 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52(correlationId) {
2611
+ return _regenerator.default.wrap(function _callee52$(_context52) {
2612
+ while (1) switch (_context52.prev = _context52.next) {
2566
2613
  case 0:
2567
2614
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2568
2615
  case 1:
2569
2616
  case "end":
2570
- return _context50.stop();
2617
+ return _context52.stop();
2571
2618
  }
2572
- }, _callee50);
2619
+ }, _callee52);
2573
2620
  }));
2574
2621
  return function (_x7) {
2575
- return _ref51.apply(this, arguments);
2622
+ return _ref53.apply(this, arguments);
2576
2623
  };
2577
2624
  }());
2578
2625
  call.doHoldResume();
2579
- _context51.next = 11;
2626
+ _context53.next = 11;
2580
2627
  return _promise.default.resolve();
2581
2628
  case 11:
2582
- _context51.next = 13;
2629
+ _context53.next = 13;
2583
2630
  return _promise.default.resolve();
2584
2631
  case 13:
2585
2632
  expect(setTimeout).not.toHaveBeenCalled();
@@ -2595,11 +2642,11 @@ describe('Supplementary Services tests', function () {
2595
2642
  call['handleIncomingRoapOffer']({}, dummyEvent);
2596
2643
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2597
2644
  roapEvent.data.type = 'ANSWER';
2598
- _context51.next = 21;
2645
+ _context53.next = 21;
2599
2646
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2600
2647
  case 21:
2601
2648
  roapEvent.data.type = 'OK';
2602
- _context51.next = 24;
2649
+ _context53.next = 24;
2603
2650
  return call['handleRoapEstablished']({}, dummyEvent);
2604
2651
  case 24:
2605
2652
  expect(clearTimeout).not.toHaveBeenCalled();
@@ -2614,14 +2661,14 @@ describe('Supplementary Services tests', function () {
2614
2661
  });
2615
2662
  case 29:
2616
2663
  case "end":
2617
- return _context51.stop();
2664
+ return _context53.stop();
2618
2665
  }
2619
- }, _callee51);
2666
+ }, _callee53);
2620
2667
  })));
2621
- it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
2668
+ it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
2622
2669
  var responsePayload;
2623
- return _regenerator.default.wrap(function _callee53$(_context53) {
2624
- while (1) switch (_context53.prev = _context53.next) {
2670
+ return _regenerator.default.wrap(function _callee55$(_context55) {
2671
+ while (1) switch (_context55.prev = _context55.next) {
2625
2672
  case 0:
2626
2673
  expect.assertions(4);
2627
2674
  responsePayload = {
@@ -2631,26 +2678,26 @@ describe('Supplementary Services tests', function () {
2631
2678
  jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2632
2679
  call['held'] = true;
2633
2680
  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) {
2681
+ var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(errObj) {
2682
+ return _regenerator.default.wrap(function _callee54$(_context54) {
2683
+ while (1) switch (_context54.prev = _context54.next) {
2637
2684
  case 0:
2638
2685
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2639
2686
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2640
2687
  case 2:
2641
2688
  case "end":
2642
- return _context52.stop();
2689
+ return _context54.stop();
2643
2690
  }
2644
- }, _callee52);
2691
+ }, _callee54);
2645
2692
  }));
2646
2693
  return function (_x8) {
2647
- return _ref53.apply(this, arguments);
2694
+ return _ref55.apply(this, arguments);
2648
2695
  };
2649
2696
  }());
2650
- _context53.next = 7;
2697
+ _context55.next = 7;
2651
2698
  return call.doHoldResume();
2652
2699
  case 7:
2653
- _context53.next = 9;
2700
+ _context55.next = 9;
2654
2701
  return (0, _testUtil.flushPromises)(2);
2655
2702
  case 9:
2656
2703
  expect(call.isHeld()).toStrictEqual(true);
@@ -2661,14 +2708,14 @@ describe('Supplementary Services tests', function () {
2661
2708
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2662
2709
  case 11:
2663
2710
  case "end":
2664
- return _context53.stop();
2711
+ return _context55.stop();
2665
2712
  }
2666
- }, _callee53);
2713
+ }, _callee55);
2667
2714
  })));
2668
- it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
2715
+ it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
2669
2716
  var responsePayload, rejectPayload, roapEvent;
2670
- return _regenerator.default.wrap(function _callee55$(_context55) {
2671
- while (1) switch (_context55.prev = _context55.next) {
2717
+ return _regenerator.default.wrap(function _callee57$(_context57) {
2718
+ while (1) switch (_context57.prev = _context57.next) {
2672
2719
  case 0:
2673
2720
  expect.assertions(5);
2674
2721
  responsePayload = {
@@ -2682,24 +2729,24 @@ describe('Supplementary Services tests', function () {
2682
2729
  jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
2683
2730
  call['held'] = true;
2684
2731
  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) {
2732
+ var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(errObj) {
2733
+ return _regenerator.default.wrap(function _callee56$(_context56) {
2734
+ while (1) switch (_context56.prev = _context56.next) {
2688
2735
  case 0:
2689
2736
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
2690
2737
  expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
2691
2738
  case 2:
2692
2739
  case "end":
2693
- return _context54.stop();
2740
+ return _context56.stop();
2694
2741
  }
2695
- }, _callee54);
2742
+ }, _callee56);
2696
2743
  }));
2697
2744
  return function (_x9) {
2698
- return _ref55.apply(this, arguments);
2745
+ return _ref57.apply(this, arguments);
2699
2746
  };
2700
2747
  }());
2701
2748
  call.doHoldResume();
2702
- _context55.next = 9;
2749
+ _context57.next = 9;
2703
2750
  return (0, _testUtil.flushPromises)(2);
2704
2751
  case 9:
2705
2752
  /* At this point , the Call State should transition to S_CALL_ESTABLISHED
@@ -2710,7 +2757,7 @@ describe('Supplementary Services tests', function () {
2710
2757
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2711
2758
  /* We are intentionally failing the ROAP ANSWER */
2712
2759
  roapEvent.data.type = 'ANSWER';
2713
- _context55.next = 15;
2760
+ _context57.next = 15;
2714
2761
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2715
2762
  case 15:
2716
2763
  expect(call.isHeld()).toStrictEqual(true);
@@ -2718,14 +2765,14 @@ describe('Supplementary Services tests', function () {
2718
2765
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2719
2766
  case 17:
2720
2767
  case "end":
2721
- return _context55.stop();
2768
+ return _context57.stop();
2722
2769
  }
2723
- }, _callee55);
2770
+ }, _callee57);
2724
2771
  })));
2725
- it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
2772
+ it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59() {
2726
2773
  var responsePayload, roapEvent;
2727
- return _regenerator.default.wrap(function _callee57$(_context57) {
2728
- while (1) switch (_context57.prev = _context57.next) {
2774
+ return _regenerator.default.wrap(function _callee59$(_context59) {
2775
+ while (1) switch (_context59.prev = _context59.next) {
2729
2776
  case 0:
2730
2777
  expect.assertions(5);
2731
2778
  responsePayload = {
@@ -2735,24 +2782,24 @@ describe('Supplementary Services tests', function () {
2735
2782
  jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
2736
2783
  call['held'] = true;
2737
2784
  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) {
2785
+ var _ref59 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(errObj) {
2786
+ return _regenerator.default.wrap(function _callee58$(_context58) {
2787
+ while (1) switch (_context58.prev = _context58.next) {
2741
2788
  case 0:
2742
2789
  expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
2743
2790
  expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
2744
2791
  case 2:
2745
2792
  case "end":
2746
- return _context56.stop();
2793
+ return _context58.stop();
2747
2794
  }
2748
- }, _callee56);
2795
+ }, _callee58);
2749
2796
  }));
2750
2797
  return function (_x10) {
2751
- return _ref57.apply(this, arguments);
2798
+ return _ref59.apply(this, arguments);
2752
2799
  };
2753
2800
  }());
2754
2801
  call.doHoldResume();
2755
- _context57.next = 8;
2802
+ _context59.next = 8;
2756
2803
  return (0, _testUtil.flushPromises)(2);
2757
2804
  case 8:
2758
2805
  /* At this point ,the Call State should be S_CALL_RESUME
@@ -2765,11 +2812,11 @@ describe('Supplementary Services tests', function () {
2765
2812
  call['handleIncomingRoapOffer']({}, dummyEvent);
2766
2813
  roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
2767
2814
  roapEvent.data.type = 'ANSWER';
2768
- _context57.next = 14;
2815
+ _context59.next = 14;
2769
2816
  return call['handleOutgoingRoapAnswer']({}, dummyEvent);
2770
2817
  case 14:
2771
2818
  roapEvent.data.type = 'OK';
2772
- _context57.next = 17;
2819
+ _context59.next = 17;
2773
2820
  return call['handleRoapEstablished']({}, dummyEvent);
2774
2821
  case 17:
2775
2822
  /* Advancing timer by 12 seconds so that it gets timed out */
@@ -2779,9 +2826,9 @@ describe('Supplementary Services tests', function () {
2779
2826
  expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
2780
2827
  case 20:
2781
2828
  case "end":
2782
- return _context57.stop();
2829
+ return _context59.stop();
2783
2830
  }
2784
- }, _callee57);
2831
+ }, _callee59);
2785
2832
  })));
2786
2833
  });
2787
2834
  describe('Call transfer tests', function () {
@@ -2803,20 +2850,20 @@ describe('Supplementary Services tests', function () {
2803
2850
  call['held'] = true;
2804
2851
 
2805
2852
  /* 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 () {
2853
+ secondCall = new _call.Call(activeUrl, webex, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, function () {
2807
2854
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2808
2855
  var dummy = 10;
2809
- }, defaultServiceIndicator);
2856
+ }, defaultServiceIndicator, transfereeDest);
2810
2857
  secondCall['connected'] = true;
2811
2858
  secondCall['earlyMedia'] = false;
2812
2859
  secondCall['callStateMachine'].state.value = 'S_CALL_ESTABLISHED';
2813
2860
  secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
2814
2861
  secondCall['held'] = false;
2815
2862
  });
2816
- it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
2863
+ it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62() {
2817
2864
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
2818
- return _regenerator.default.wrap(function _callee60$(_context60) {
2819
- while (1) switch (_context60.prev = _context60.next) {
2865
+ return _regenerator.default.wrap(function _callee62$(_context62) {
2866
+ while (1) switch (_context62.prev = _context62.next) {
2820
2867
  case 0:
2821
2868
  expect.assertions(9);
2822
2869
  responsePayload = {
@@ -2828,41 +2875,41 @@ describe('Supplementary Services tests', function () {
2828
2875
  infoSpy = jest.spyOn(_Logger.default, 'info');
2829
2876
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
2830
2877
  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) {
2878
+ var _ref61 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60(correlationId) {
2879
+ return _regenerator.default.wrap(function _callee60$(_context60) {
2880
+ while (1) switch (_context60.prev = _context60.next) {
2834
2881
  case 0:
2835
2882
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2836
2883
  case 1:
2837
2884
  case "end":
2838
- return _context58.stop();
2885
+ return _context60.stop();
2839
2886
  }
2840
- }, _callee58);
2887
+ }, _callee60);
2841
2888
  }));
2842
2889
  return function (_x11) {
2843
- return _ref59.apply(this, arguments);
2890
+ return _ref61.apply(this, arguments);
2844
2891
  };
2845
2892
  }());
2846
2893
  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) {
2894
+ var _ref62 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(correlationId) {
2895
+ return _regenerator.default.wrap(function _callee61$(_context61) {
2896
+ while (1) switch (_context61.prev = _context61.next) {
2850
2897
  case 0:
2851
2898
  expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
2852
2899
  case 1:
2853
2900
  case "end":
2854
- return _context59.stop();
2901
+ return _context61.stop();
2855
2902
  }
2856
- }, _callee59);
2903
+ }, _callee61);
2857
2904
  }));
2858
2905
  return function (_x12) {
2859
- return _ref60.apply(this, arguments);
2906
+ return _ref62.apply(this, arguments);
2860
2907
  };
2861
2908
  }());
2862
- _context60.next = 10;
2909
+ _context62.next = 10;
2863
2910
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
2864
2911
  case 10:
2865
- _context60.next = 12;
2912
+ _context62.next = 12;
2866
2913
  return (0, _testUtil.flushPromises)(2);
2867
2914
  case 12:
2868
2915
  expect(requestSpy).toBeCalled();
@@ -2882,14 +2929,14 @@ describe('Supplementary Services tests', function () {
2882
2929
  expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
2883
2930
  case 21:
2884
2931
  case "end":
2885
- return _context60.stop();
2932
+ return _context62.stop();
2886
2933
  }
2887
- }, _callee60);
2934
+ }, _callee62);
2888
2935
  })));
2889
- it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62() {
2936
+ it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64() {
2890
2937
  var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
2891
- return _regenerator.default.wrap(function _callee62$(_context62) {
2892
- while (1) switch (_context62.prev = _context62.next) {
2938
+ return _regenerator.default.wrap(function _callee64$(_context64) {
2939
+ while (1) switch (_context64.prev = _context64.next) {
2893
2940
  case 0:
2894
2941
  expect.assertions(7);
2895
2942
  responsePayload = {
@@ -2901,25 +2948,25 @@ describe('Supplementary Services tests', function () {
2901
2948
  infoSpy = jest.spyOn(_Logger.default, 'info');
2902
2949
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
2903
2950
  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) {
2951
+ var _ref64 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63(correlationId) {
2952
+ return _regenerator.default.wrap(function _callee63$(_context63) {
2953
+ while (1) switch (_context63.prev = _context63.next) {
2907
2954
  case 0:
2908
2955
  expect(correlationId).toStrictEqual(call.getCorrelationId());
2909
2956
  case 1:
2910
2957
  case "end":
2911
- return _context61.stop();
2958
+ return _context63.stop();
2912
2959
  }
2913
- }, _callee61);
2960
+ }, _callee63);
2914
2961
  }));
2915
2962
  return function (_x13) {
2916
- return _ref62.apply(this, arguments);
2963
+ return _ref64.apply(this, arguments);
2917
2964
  };
2918
2965
  }());
2919
- _context62.next = 9;
2966
+ _context64.next = 9;
2920
2967
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
2921
2968
  case 9:
2922
- _context62.next = 11;
2969
+ _context64.next = 11;
2923
2970
  return (0, _testUtil.flushPromises)(2);
2924
2971
  case 11:
2925
2972
  expect(requestSpy).toBeCalled();
@@ -2935,14 +2982,14 @@ describe('Supplementary Services tests', function () {
2935
2982
  expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
2936
2983
  case 18:
2937
2984
  case "end":
2938
- return _context62.stop();
2985
+ return _context64.stop();
2939
2986
  }
2940
- }, _callee62);
2987
+ }, _callee64);
2941
2988
  })));
2942
- it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63() {
2989
+ it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee65() {
2943
2990
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
2944
- return _regenerator.default.wrap(function _callee63$(_context63) {
2945
- while (1) switch (_context63.prev = _context63.next) {
2991
+ return _regenerator.default.wrap(function _callee65$(_context65) {
2992
+ while (1) switch (_context65.prev = _context65.next) {
2946
2993
  case 0:
2947
2994
  responsePayload = {
2948
2995
  statusCode: 403,
@@ -2952,10 +2999,10 @@ describe('Supplementary Services tests', function () {
2952
2999
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2953
3000
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2954
3001
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
2955
- _context63.next = 7;
3002
+ _context65.next = 7;
2956
3003
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
2957
3004
  case 7:
2958
- _context63.next = 9;
3005
+ _context65.next = 9;
2959
3006
  return (0, _testUtil.flushPromises)(1);
2960
3007
  case 9:
2961
3008
  expect(requestSpy).toBeCalled();
@@ -2971,14 +3018,14 @@ describe('Supplementary Services tests', function () {
2971
3018
  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
3019
  case 16:
2973
3020
  case "end":
2974
- return _context63.stop();
3021
+ return _context65.stop();
2975
3022
  }
2976
- }, _callee63);
3023
+ }, _callee65);
2977
3024
  })));
2978
- it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64() {
3025
+ it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee66() {
2979
3026
  var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
2980
- return _regenerator.default.wrap(function _callee64$(_context64) {
2981
- while (1) switch (_context64.prev = _context64.next) {
3027
+ return _regenerator.default.wrap(function _callee66$(_context66) {
3028
+ while (1) switch (_context66.prev = _context66.next) {
2982
3029
  case 0:
2983
3030
  responsePayload = {
2984
3031
  statusCode: 403,
@@ -2988,10 +3035,10 @@ describe('Supplementary Services tests', function () {
2988
3035
  requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
2989
3036
  warnSpy = jest.spyOn(_Logger.default, 'warn');
2990
3037
  metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
2991
- _context64.next = 7;
3038
+ _context66.next = 7;
2992
3039
  return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
2993
3040
  case 7:
2994
- _context64.next = 9;
3041
+ _context66.next = 9;
2995
3042
  return (0, _testUtil.flushPromises)(2);
2996
3043
  case 9:
2997
3044
  expect(requestSpy).toBeCalled();
@@ -3008,18 +3055,18 @@ describe('Supplementary Services tests', function () {
3008
3055
  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
3056
  case 17:
3010
3057
  case "end":
3011
- return _context64.stop();
3058
+ return _context66.stop();
3012
3059
  }
3013
- }, _callee64);
3060
+ }, _callee66);
3014
3061
  })));
3015
- it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee65() {
3062
+ it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee67() {
3016
3063
  var requestSpy, warnSpy;
3017
- return _regenerator.default.wrap(function _callee65$(_context65) {
3018
- while (1) switch (_context65.prev = _context65.next) {
3064
+ return _regenerator.default.wrap(function _callee67$(_context67) {
3065
+ while (1) switch (_context67.prev = _context67.next) {
3019
3066
  case 0:
3020
3067
  requestSpy = jest.spyOn(webex, 'request');
3021
3068
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3022
- _context65.next = 4;
3069
+ _context67.next = 4;
3023
3070
  return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
3024
3071
  case 4:
3025
3072
  /* We should be in CALL_ESTABLISHED state */
@@ -3030,18 +3077,18 @@ describe('Supplementary Services tests', function () {
3030
3077
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3031
3078
  case 9:
3032
3079
  case "end":
3033
- return _context65.stop();
3080
+ return _context67.stop();
3034
3081
  }
3035
- }, _callee65);
3082
+ }, _callee67);
3036
3083
  })));
3037
- it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee66() {
3084
+ it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee68() {
3038
3085
  var requestSpy, warnSpy;
3039
- return _regenerator.default.wrap(function _callee66$(_context66) {
3040
- while (1) switch (_context66.prev = _context66.next) {
3086
+ return _regenerator.default.wrap(function _callee68$(_context68) {
3087
+ while (1) switch (_context68.prev = _context68.next) {
3041
3088
  case 0:
3042
3089
  requestSpy = jest.spyOn(webex, 'request');
3043
3090
  warnSpy = jest.spyOn(_Logger.default, 'warn');
3044
- _context66.next = 4;
3091
+ _context68.next = 4;
3045
3092
  return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
3046
3093
  case 4:
3047
3094
  /* We should be in CALL_ESTABLISHED state */
@@ -3052,9 +3099,9 @@ describe('Supplementary Services tests', function () {
3052
3099
  expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
3053
3100
  case 9:
3054
3101
  case "end":
3055
- return _context66.stop();
3102
+ return _context68.stop();
3056
3103
  }
3057
- }, _callee66);
3104
+ }, _callee68);
3058
3105
  })));
3059
3106
  });
3060
3107
  });