@webex/calling 3.0.0-next.17 → 3.0.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CallingClient/calling/call.js +55 -22
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +424 -348
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +1 -1
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/Errors/index.js +7 -0
- package/dist/Errors/index.js.map +1 -1
- package/dist/Events/types.js +0 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/index.js +233 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallingClient/calling/call.js +41 -17
- package/dist/module/Errors/index.js +1 -0
- package/dist/module/index.js +7 -0
- package/dist/types/CallingClient/calling/call.d.ts +1 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -1
- package/dist/types/Errors/index.d.ts +1 -0
- package/dist/types/Errors/index.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -364,6 +364,82 @@ describe('Call Tests', function () {
|
|
|
364
364
|
}
|
|
365
365
|
}, _callee7);
|
|
366
366
|
})));
|
|
367
|
+
it('answer fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
368
|
+
var mockStream, localAudioStream, warnSpy, call;
|
|
369
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
370
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
371
|
+
case 0:
|
|
372
|
+
mockStream = {
|
|
373
|
+
outputStream: {
|
|
374
|
+
getAudioTracks: jest.fn().mockReturnValue([])
|
|
375
|
+
},
|
|
376
|
+
on: jest.fn()
|
|
377
|
+
};
|
|
378
|
+
localAudioStream = mockStream;
|
|
379
|
+
webex.request.mockReturnValue({
|
|
380
|
+
statusCode: 200,
|
|
381
|
+
body: {
|
|
382
|
+
device: {
|
|
383
|
+
deviceId: '8a67806f-fc4d-446b-a131-31e71ea5b010',
|
|
384
|
+
correlationId: '8a67806f-fc4d-446b-a131-31e71ea5b011'
|
|
385
|
+
},
|
|
386
|
+
callId: '8a67806f-fc4d-446b-a131-31e71ea5b020'
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
390
|
+
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
391
|
+
call.answer(localAudioStream);
|
|
392
|
+
_context8.next = 8;
|
|
393
|
+
return (0, Utils.waitForMsecs)(50);
|
|
394
|
+
case 8:
|
|
395
|
+
expect(warnSpy).toBeCalledTimes(2);
|
|
396
|
+
expect(warnSpy).toBeCalledWith("Did not find a local track while answering the call ".concat(call.getCorrelationId()), {
|
|
397
|
+
file: 'call',
|
|
398
|
+
method: 'answer'
|
|
399
|
+
});
|
|
400
|
+
expect(call['callStateMachine'].state.value).toBe('S_CALL_CLEARED');
|
|
401
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_IDLE');
|
|
402
|
+
expect(call.getDisconnectReason().code).toBe(_types5.DisconnectCode.MEDIA_INACTIVITY);
|
|
403
|
+
expect(call.getDisconnectReason().cause).toBe(_types5.DisconnectCause.MEDIA_INACTIVITY);
|
|
404
|
+
expect(webex.request.mock.calls[0][0].body.metrics).toStrictEqual(disconnectStats);
|
|
405
|
+
case 15:
|
|
406
|
+
case "end":
|
|
407
|
+
return _context8.stop();
|
|
408
|
+
}
|
|
409
|
+
}, _callee8);
|
|
410
|
+
})));
|
|
411
|
+
it('dial fails if localAudioTrack is empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
412
|
+
var mockStream, localAudioStream, warnSpy, call;
|
|
413
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
414
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
415
|
+
case 0:
|
|
416
|
+
mockStream = {
|
|
417
|
+
outputStream: {
|
|
418
|
+
getAudioTracks: jest.fn().mockReturnValue([])
|
|
419
|
+
},
|
|
420
|
+
on: jest.fn()
|
|
421
|
+
};
|
|
422
|
+
localAudioStream = mockStream;
|
|
423
|
+
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
424
|
+
call = (0, _call.createCall)(activeUrl, webex, dest, _types3.CallDirection.OUTBOUND, deviceId, mockLineId, deleteCallFromCollection, defaultServiceIndicator);
|
|
425
|
+
call.dial(localAudioStream);
|
|
426
|
+
_context9.next = 7;
|
|
427
|
+
return (0, Utils.waitForMsecs)(50);
|
|
428
|
+
case 7:
|
|
429
|
+
expect(warnSpy).toBeCalledTimes(1);
|
|
430
|
+
expect(warnSpy).toBeCalledWith("Did not find a local track while dialling the call ".concat(call.getCorrelationId()), {
|
|
431
|
+
file: 'call',
|
|
432
|
+
method: 'dial'
|
|
433
|
+
});
|
|
434
|
+
expect(call['callStateMachine'].state.value).toBe('S_IDLE');
|
|
435
|
+
expect(call['mediaStateMachine'].state.value).toBe('S_ROAP_IDLE');
|
|
436
|
+
expect(webex.request).not.toBeCalledOnceWith();
|
|
437
|
+
case 12:
|
|
438
|
+
case "end":
|
|
439
|
+
return _context9.stop();
|
|
440
|
+
}
|
|
441
|
+
}, _callee9);
|
|
442
|
+
})));
|
|
367
443
|
});
|
|
368
444
|
describe('State Machine handler tests', function () {
|
|
369
445
|
var deviceId = '55dfb53f-bed2-36da-8e85-cee7f02aa68e';
|
|
@@ -394,10 +470,10 @@ describe('State Machine handler tests', function () {
|
|
|
394
470
|
|
|
395
471
|
// afterEach(() => call.removeAllListeners());
|
|
396
472
|
|
|
397
|
-
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
473
|
+
it('successful session refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
398
474
|
var statusPayload, dummyEvent, funcSpy, logSpy;
|
|
399
|
-
return _regenerator.default.wrap(function
|
|
400
|
-
while (1) switch (
|
|
475
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
476
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
401
477
|
case 0:
|
|
402
478
|
statusPayload = {
|
|
403
479
|
statusCode: 200,
|
|
@@ -417,7 +493,7 @@ describe('State Machine handler tests', function () {
|
|
|
417
493
|
/* This is to flush all the promises from the Promise queue so that
|
|
418
494
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
419
495
|
*/
|
|
420
|
-
|
|
496
|
+
_context10.next = 11;
|
|
421
497
|
return (0, _testUtil.flushPromises)(3);
|
|
422
498
|
case 11:
|
|
423
499
|
expect(setInterval).toHaveBeenCalledTimes(1);
|
|
@@ -428,14 +504,14 @@ describe('State Machine handler tests', function () {
|
|
|
428
504
|
});
|
|
429
505
|
case 14:
|
|
430
506
|
case "end":
|
|
431
|
-
return
|
|
507
|
+
return _context10.stop();
|
|
432
508
|
}
|
|
433
|
-
},
|
|
509
|
+
}, _callee10);
|
|
434
510
|
})));
|
|
435
|
-
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
511
|
+
it('session refresh failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
436
512
|
var statusPayload, funcSpy;
|
|
437
|
-
return _regenerator.default.wrap(function
|
|
438
|
-
while (1) switch (
|
|
513
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
514
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
439
515
|
case 0:
|
|
440
516
|
expect.assertions(4);
|
|
441
517
|
statusPayload = {
|
|
@@ -459,24 +535,24 @@ describe('State Machine handler tests', function () {
|
|
|
459
535
|
/* This is to flush all the promises from the Promise queue so that
|
|
460
536
|
* Jest.fakeTimers can advance time and also clear the promise Queue
|
|
461
537
|
*/
|
|
462
|
-
|
|
538
|
+
_context11.next = 11;
|
|
463
539
|
return _promise.default.resolve();
|
|
464
540
|
case 11:
|
|
465
|
-
|
|
541
|
+
_context11.next = 13;
|
|
466
542
|
return _promise.default.resolve();
|
|
467
543
|
case 13:
|
|
468
544
|
expect(clearInterval).toHaveBeenCalledTimes(1);
|
|
469
545
|
expect(funcSpy).toBeCalledTimes(1);
|
|
470
546
|
case 15:
|
|
471
547
|
case "end":
|
|
472
|
-
return
|
|
548
|
+
return _context11.stop();
|
|
473
549
|
}
|
|
474
|
-
},
|
|
550
|
+
}, _callee11);
|
|
475
551
|
})));
|
|
476
|
-
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
552
|
+
it('state changes during successful incoming call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
477
553
|
var statusPayload, dummyEvent, postMediaSpy, deleteSpy, dummyOkEvent;
|
|
478
|
-
return _regenerator.default.wrap(function
|
|
479
|
-
while (1) switch (
|
|
554
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
555
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
480
556
|
case 0:
|
|
481
557
|
statusPayload = {
|
|
482
558
|
statusCode: 200,
|
|
@@ -532,14 +608,14 @@ describe('State Machine handler tests', function () {
|
|
|
532
608
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
533
609
|
case 27:
|
|
534
610
|
case "end":
|
|
535
|
-
return
|
|
611
|
+
return _context12.stop();
|
|
536
612
|
}
|
|
537
|
-
},
|
|
613
|
+
}, _callee12);
|
|
538
614
|
})));
|
|
539
|
-
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
615
|
+
it('state changes during unsuccessful incoming call due to no offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
540
616
|
var statusPayload, dummyEvent;
|
|
541
|
-
return _regenerator.default.wrap(function
|
|
542
|
-
while (1) switch (
|
|
617
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
618
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
543
619
|
case 0:
|
|
544
620
|
call['direction'] = _types3.CallDirection.INBOUND;
|
|
545
621
|
statusPayload = {
|
|
@@ -557,7 +633,7 @@ describe('State Machine handler tests', function () {
|
|
|
557
633
|
webex.request.mockReturnValue(statusPayload);
|
|
558
634
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
559
635
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_PROGRESS');
|
|
560
|
-
|
|
636
|
+
_context13.next = 8;
|
|
561
637
|
return call['handleOutgoingCallConnect']({
|
|
562
638
|
type: 'E_SEND_CALL_CONNECT'
|
|
563
639
|
});
|
|
@@ -571,14 +647,14 @@ describe('State Machine handler tests', function () {
|
|
|
571
647
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
572
648
|
case 12:
|
|
573
649
|
case "end":
|
|
574
|
-
return
|
|
650
|
+
return _context13.stop();
|
|
575
651
|
}
|
|
576
|
-
},
|
|
652
|
+
}, _callee13);
|
|
577
653
|
})));
|
|
578
|
-
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
654
|
+
it('state changes during unsuccessful incoming call due error in call connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
579
655
|
var warnSpy, stateMachineSpy, statusPayload, roapMessage;
|
|
580
|
-
return _regenerator.default.wrap(function
|
|
581
|
-
while (1) switch (
|
|
656
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
657
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
582
658
|
case 0:
|
|
583
659
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
584
660
|
stateMachineSpy = jest.spyOn(call, 'sendCallStateMachineEvt');
|
|
@@ -604,7 +680,7 @@ describe('State Machine handler tests', function () {
|
|
|
604
680
|
webex.request.mockRejectedValueOnce({
|
|
605
681
|
statusCode: 403
|
|
606
682
|
}).mockResolvedValue(statusPayload);
|
|
607
|
-
|
|
683
|
+
_context14.next = 12;
|
|
608
684
|
return call['handleOutgoingCallConnect']({
|
|
609
685
|
type: 'E_SEND_CALL_CONNECT'
|
|
610
686
|
});
|
|
@@ -621,14 +697,14 @@ describe('State Machine handler tests', function () {
|
|
|
621
697
|
});
|
|
622
698
|
case 18:
|
|
623
699
|
case "end":
|
|
624
|
-
return
|
|
700
|
+
return _context14.stop();
|
|
625
701
|
}
|
|
626
|
-
},
|
|
702
|
+
}, _callee14);
|
|
627
703
|
})));
|
|
628
|
-
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
704
|
+
it('state changes during successful outgoing call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
629
705
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent;
|
|
630
|
-
return _regenerator.default.wrap(function
|
|
631
|
-
while (1) switch (
|
|
706
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
707
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
632
708
|
case 0:
|
|
633
709
|
statusPayload = {
|
|
634
710
|
statusCode: 200,
|
|
@@ -702,14 +778,14 @@ describe('State Machine handler tests', function () {
|
|
|
702
778
|
expect(call['callStateMachine'].state.value).toBe('S_SEND_CALL_DISCONNECT');
|
|
703
779
|
case 40:
|
|
704
780
|
case "end":
|
|
705
|
-
return
|
|
781
|
+
return _context15.stop();
|
|
706
782
|
}
|
|
707
|
-
},
|
|
783
|
+
}, _callee15);
|
|
708
784
|
})));
|
|
709
|
-
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
785
|
+
it('state changes during successful outgoing call with early media', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
710
786
|
var statusPayload, dummyEvent;
|
|
711
|
-
return _regenerator.default.wrap(function
|
|
712
|
-
while (1) switch (
|
|
787
|
+
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
788
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
713
789
|
case 0:
|
|
714
790
|
statusPayload = {
|
|
715
791
|
statusCode: 200,
|
|
@@ -748,14 +824,14 @@ describe('State Machine handler tests', function () {
|
|
|
748
824
|
expect(call['callStateMachine'].state.value).toBe('S_RECV_CALL_DISCONNECT');
|
|
749
825
|
case 17:
|
|
750
826
|
case "end":
|
|
751
|
-
return
|
|
827
|
+
return _context16.stop();
|
|
752
828
|
}
|
|
753
|
-
},
|
|
829
|
+
}, _callee16);
|
|
754
830
|
})));
|
|
755
|
-
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
831
|
+
it('state changes during unsuccessful outgoing call due to error in call setup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
756
832
|
var statusPayload, dummyEvent;
|
|
757
|
-
return _regenerator.default.wrap(function
|
|
758
|
-
while (1) switch (
|
|
833
|
+
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
834
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
759
835
|
case 0:
|
|
760
836
|
statusPayload = {
|
|
761
837
|
statusCode: 403,
|
|
@@ -771,20 +847,20 @@ describe('State Machine handler tests', function () {
|
|
|
771
847
|
};
|
|
772
848
|
webex.request.mockRejectedValueOnce(statusPayload);
|
|
773
849
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
774
|
-
|
|
850
|
+
_context17.next = 6;
|
|
775
851
|
return (0, _testUtil.flushPromises)(3);
|
|
776
852
|
case 6:
|
|
777
853
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
778
854
|
case 7:
|
|
779
855
|
case "end":
|
|
780
|
-
return
|
|
856
|
+
return _context17.stop();
|
|
781
857
|
}
|
|
782
|
-
},
|
|
858
|
+
}, _callee17);
|
|
783
859
|
})));
|
|
784
|
-
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
860
|
+
it('state changes during unsuccessful outgoing call due to error in media ok', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
785
861
|
var statusPayload, dummyEvent;
|
|
786
|
-
return _regenerator.default.wrap(function
|
|
787
|
-
while (1) switch (
|
|
862
|
+
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
863
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
788
864
|
case 0:
|
|
789
865
|
statusPayload = {
|
|
790
866
|
statusCode: 403,
|
|
@@ -801,10 +877,10 @@ describe('State Machine handler tests', function () {
|
|
|
801
877
|
call['earlyMedia'] = true;
|
|
802
878
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
803
879
|
webex.request.mockRejectedValue(statusPayload);
|
|
804
|
-
|
|
880
|
+
_context18.next = 8;
|
|
805
881
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
806
882
|
case 8:
|
|
807
|
-
|
|
883
|
+
_context18.next = 10;
|
|
808
884
|
return (0, _testUtil.flushPromises)(2);
|
|
809
885
|
case 10:
|
|
810
886
|
expect(call.isConnected()).toBe(false);
|
|
@@ -812,14 +888,14 @@ describe('State Machine handler tests', function () {
|
|
|
812
888
|
expect(call['callStateMachine'].state.value).toBe('S_UNKNOWN');
|
|
813
889
|
case 13:
|
|
814
890
|
case "end":
|
|
815
|
-
return
|
|
891
|
+
return _context18.stop();
|
|
816
892
|
}
|
|
817
|
-
},
|
|
893
|
+
}, _callee18);
|
|
818
894
|
})));
|
|
819
|
-
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
895
|
+
it('state changes during unsuccessful outgoing call since no sdp in offer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
820
896
|
var statusPayload, dummyEvent;
|
|
821
|
-
return _regenerator.default.wrap(function
|
|
822
|
-
while (1) switch (
|
|
897
|
+
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
898
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
823
899
|
case 0:
|
|
824
900
|
statusPayload = {
|
|
825
901
|
statusCode: 403,
|
|
@@ -842,14 +918,14 @@ describe('State Machine handler tests', function () {
|
|
|
842
918
|
expect(_testUtil.mediaConnection.initiateOffer).toBeCalledOnceWith();
|
|
843
919
|
case 8:
|
|
844
920
|
case "end":
|
|
845
|
-
return
|
|
921
|
+
return _context19.stop();
|
|
846
922
|
}
|
|
847
|
-
},
|
|
923
|
+
}, _callee19);
|
|
848
924
|
})));
|
|
849
|
-
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
925
|
+
it('Outgoing Roap offer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
|
|
850
926
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
851
|
-
return _regenerator.default.wrap(function
|
|
852
|
-
while (1) switch (
|
|
927
|
+
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
928
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
853
929
|
case 0:
|
|
854
930
|
statusPayload = {
|
|
855
931
|
statusCode: 503,
|
|
@@ -871,7 +947,7 @@ describe('State Machine handler tests', function () {
|
|
|
871
947
|
}
|
|
872
948
|
};
|
|
873
949
|
call['connected'] = true;
|
|
874
|
-
|
|
950
|
+
_context20.next = 8;
|
|
875
951
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
876
952
|
case 8:
|
|
877
953
|
jest.advanceTimersByTime(1005);
|
|
@@ -883,14 +959,14 @@ describe('State Machine handler tests', function () {
|
|
|
883
959
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
884
960
|
case 13:
|
|
885
961
|
case "end":
|
|
886
|
-
return
|
|
962
|
+
return _context20.stop();
|
|
887
963
|
}
|
|
888
|
-
},
|
|
964
|
+
}, _callee20);
|
|
889
965
|
})));
|
|
890
|
-
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
966
|
+
it('Outgoing Roap offer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
891
967
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
892
|
-
return _regenerator.default.wrap(function
|
|
893
|
-
while (1) switch (
|
|
968
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
969
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
894
970
|
case 0:
|
|
895
971
|
statusPayload = {
|
|
896
972
|
statusCode: 503,
|
|
@@ -912,7 +988,7 @@ describe('State Machine handler tests', function () {
|
|
|
912
988
|
}
|
|
913
989
|
};
|
|
914
990
|
call['connected'] = false;
|
|
915
|
-
|
|
991
|
+
_context21.next = 8;
|
|
916
992
|
return call['handleOutgoingRoapOffer']({}, dummyEvent);
|
|
917
993
|
case 8:
|
|
918
994
|
jest.advanceTimersByTime(1005);
|
|
@@ -923,14 +999,14 @@ describe('State Machine handler tests', function () {
|
|
|
923
999
|
expect(stateMachineSpy).not.toBeCalled();
|
|
924
1000
|
case 12:
|
|
925
1001
|
case "end":
|
|
926
|
-
return
|
|
1002
|
+
return _context21.stop();
|
|
927
1003
|
}
|
|
928
|
-
},
|
|
1004
|
+
}, _callee21);
|
|
929
1005
|
})));
|
|
930
|
-
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1006
|
+
it('Outgoing Roap Answer retry-after error case during midcall', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
931
1007
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
932
|
-
return _regenerator.default.wrap(function
|
|
933
|
-
while (1) switch (
|
|
1008
|
+
return _regenerator.default.wrap(function _callee22$(_context22) {
|
|
1009
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
934
1010
|
case 0:
|
|
935
1011
|
statusPayload = {
|
|
936
1012
|
statusCode: 503,
|
|
@@ -952,7 +1028,7 @@ describe('State Machine handler tests', function () {
|
|
|
952
1028
|
};
|
|
953
1029
|
call['connected'] = true;
|
|
954
1030
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_OFFER';
|
|
955
|
-
|
|
1031
|
+
_context22.next = 9;
|
|
956
1032
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
957
1033
|
case 9:
|
|
958
1034
|
jest.advanceTimersByTime(1005);
|
|
@@ -964,14 +1040,14 @@ describe('State Machine handler tests', function () {
|
|
|
964
1040
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
965
1041
|
case 14:
|
|
966
1042
|
case "end":
|
|
967
|
-
return
|
|
1043
|
+
return _context22.stop();
|
|
968
1044
|
}
|
|
969
|
-
},
|
|
1045
|
+
}, _callee22);
|
|
970
1046
|
})));
|
|
971
|
-
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1047
|
+
it('Outgoing Roap answer retry-after error case during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
|
|
972
1048
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
973
|
-
return _regenerator.default.wrap(function
|
|
974
|
-
while (1) switch (
|
|
1049
|
+
return _regenerator.default.wrap(function _callee23$(_context23) {
|
|
1050
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
975
1051
|
case 0:
|
|
976
1052
|
statusPayload = {
|
|
977
1053
|
statusCode: 503,
|
|
@@ -992,7 +1068,7 @@ describe('State Machine handler tests', function () {
|
|
|
992
1068
|
}
|
|
993
1069
|
};
|
|
994
1070
|
call['connected'] = false;
|
|
995
|
-
|
|
1071
|
+
_context23.next = 8;
|
|
996
1072
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
997
1073
|
case 8:
|
|
998
1074
|
jest.advanceTimersByTime(1005);
|
|
@@ -1004,14 +1080,14 @@ describe('State Machine handler tests', function () {
|
|
|
1004
1080
|
expect(stateMachineSpy).not.toBeCalled();
|
|
1005
1081
|
case 13:
|
|
1006
1082
|
case "end":
|
|
1007
|
-
return
|
|
1083
|
+
return _context23.stop();
|
|
1008
1084
|
}
|
|
1009
|
-
},
|
|
1085
|
+
}, _callee23);
|
|
1010
1086
|
})));
|
|
1011
|
-
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1087
|
+
it('ROAP error during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
|
|
1012
1088
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1013
|
-
return _regenerator.default.wrap(function
|
|
1014
|
-
while (1) switch (
|
|
1089
|
+
return _regenerator.default.wrap(function _callee24$(_context24) {
|
|
1090
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1015
1091
|
case 0:
|
|
1016
1092
|
statusPayload = {
|
|
1017
1093
|
statusCode: 200,
|
|
@@ -1036,14 +1112,14 @@ describe('State Machine handler tests', function () {
|
|
|
1036
1112
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1037
1113
|
case 11:
|
|
1038
1114
|
case "end":
|
|
1039
|
-
return
|
|
1115
|
+
return _context24.stop();
|
|
1040
1116
|
}
|
|
1041
|
-
},
|
|
1117
|
+
}, _callee24);
|
|
1042
1118
|
})));
|
|
1043
|
-
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1119
|
+
it('ROAP ok retry-after during mid call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1044
1120
|
var statusPayload, funcSpy, stateMachineSpy, dummyEvent;
|
|
1045
|
-
return _regenerator.default.wrap(function
|
|
1046
|
-
while (1) switch (
|
|
1121
|
+
return _regenerator.default.wrap(function _callee25$(_context25) {
|
|
1122
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1047
1123
|
case 0:
|
|
1048
1124
|
statusPayload = {
|
|
1049
1125
|
statusCode: 503,
|
|
@@ -1065,7 +1141,7 @@ describe('State Machine handler tests', function () {
|
|
|
1065
1141
|
};
|
|
1066
1142
|
call['connected'] = true;
|
|
1067
1143
|
call['mediaStateMachine'].state.value = 'S_RECV_ROAP_ANSWER';
|
|
1068
|
-
|
|
1144
|
+
_context25.next = 9;
|
|
1069
1145
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1070
1146
|
case 9:
|
|
1071
1147
|
jest.advanceTimersByTime(1005);
|
|
@@ -1077,14 +1153,14 @@ describe('State Machine handler tests', function () {
|
|
|
1077
1153
|
expect(stateMachineSpy).toBeCalledOnceWith(dummyEvent);
|
|
1078
1154
|
case 14:
|
|
1079
1155
|
case "end":
|
|
1080
|
-
return
|
|
1156
|
+
return _context25.stop();
|
|
1081
1157
|
}
|
|
1082
|
-
},
|
|
1158
|
+
}, _callee25);
|
|
1083
1159
|
})));
|
|
1084
|
-
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1160
|
+
it('Unable to communicate roap error with mobius', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
|
|
1085
1161
|
var statusPayload, stateMachineSpy, funcSpy, errorEvent;
|
|
1086
|
-
return _regenerator.default.wrap(function
|
|
1087
|
-
while (1) switch (
|
|
1162
|
+
return _regenerator.default.wrap(function _callee26$(_context26) {
|
|
1163
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1088
1164
|
case 0:
|
|
1089
1165
|
statusPayload = {
|
|
1090
1166
|
statusCode: 403,
|
|
@@ -1107,14 +1183,14 @@ describe('State Machine handler tests', function () {
|
|
|
1107
1183
|
expect(stateMachineSpy).not.toHaveBeenCalled();
|
|
1108
1184
|
case 9:
|
|
1109
1185
|
case "end":
|
|
1110
|
-
return
|
|
1186
|
+
return _context26.stop();
|
|
1111
1187
|
}
|
|
1112
|
-
},
|
|
1188
|
+
}, _callee26);
|
|
1113
1189
|
})));
|
|
1114
|
-
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1190
|
+
it('ROAP error during call establishment', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1115
1191
|
var statusPayload, warnSpy, stateMachineSpy, funcSpy, errorEvent;
|
|
1116
|
-
return _regenerator.default.wrap(function
|
|
1117
|
-
while (1) switch (
|
|
1192
|
+
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
1193
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1118
1194
|
case 0:
|
|
1119
1195
|
statusPayload = {
|
|
1120
1196
|
statusCode: 200,
|
|
@@ -1132,7 +1208,7 @@ describe('State Machine handler tests', function () {
|
|
|
1132
1208
|
}
|
|
1133
1209
|
};
|
|
1134
1210
|
call['connected'] = false;
|
|
1135
|
-
|
|
1211
|
+
_context27.next = 8;
|
|
1136
1212
|
return call['handleRoapError']({}, errorEvent);
|
|
1137
1213
|
case 8:
|
|
1138
1214
|
expect(funcSpy).toBeCalledOnceWith(errorEvent.data);
|
|
@@ -1148,14 +1224,14 @@ describe('State Machine handler tests', function () {
|
|
|
1148
1224
|
});
|
|
1149
1225
|
case 11:
|
|
1150
1226
|
case "end":
|
|
1151
|
-
return
|
|
1227
|
+
return _context27.stop();
|
|
1152
1228
|
}
|
|
1153
|
-
},
|
|
1229
|
+
}, _callee27);
|
|
1154
1230
|
})));
|
|
1155
|
-
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1231
|
+
it('state changes during successful incoming call with out of order events', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
|
|
1156
1232
|
var statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1157
|
-
return _regenerator.default.wrap(function
|
|
1158
|
-
while (1) switch (
|
|
1233
|
+
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
1234
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1159
1235
|
case 0:
|
|
1160
1236
|
statusPayload = {
|
|
1161
1237
|
statusCode: 200,
|
|
@@ -1188,7 +1264,7 @@ describe('State Machine handler tests', function () {
|
|
|
1188
1264
|
seq: 1,
|
|
1189
1265
|
messageType: 'ANSWER'
|
|
1190
1266
|
};
|
|
1191
|
-
|
|
1267
|
+
_context28.next = 17;
|
|
1192
1268
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1193
1269
|
case 17:
|
|
1194
1270
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1210,7 +1286,7 @@ describe('State Machine handler tests', function () {
|
|
|
1210
1286
|
seq: 2,
|
|
1211
1287
|
messageType: 'OFFER_REQUEST'
|
|
1212
1288
|
};
|
|
1213
|
-
|
|
1289
|
+
_context28.next = 23;
|
|
1214
1290
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1215
1291
|
case 23:
|
|
1216
1292
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1260,7 +1336,7 @@ describe('State Machine handler tests', function () {
|
|
|
1260
1336
|
};
|
|
1261
1337
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1262
1338
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1263
|
-
|
|
1339
|
+
_context28.next = 49;
|
|
1264
1340
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1265
1341
|
case 49:
|
|
1266
1342
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1269,7 +1345,7 @@ describe('State Machine handler tests', function () {
|
|
|
1269
1345
|
seq: 3,
|
|
1270
1346
|
messageType: 'ANSWER'
|
|
1271
1347
|
};
|
|
1272
|
-
|
|
1348
|
+
_context28.next = 54;
|
|
1273
1349
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1274
1350
|
case 54:
|
|
1275
1351
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1288,7 +1364,7 @@ describe('State Machine handler tests', function () {
|
|
|
1288
1364
|
messageType: 'OK'
|
|
1289
1365
|
}
|
|
1290
1366
|
};
|
|
1291
|
-
|
|
1367
|
+
_context28.next = 63;
|
|
1292
1368
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1293
1369
|
case 63:
|
|
1294
1370
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenNthCalledWith(6, dummyOkEvent.data.message);
|
|
@@ -1303,14 +1379,14 @@ describe('State Machine handler tests', function () {
|
|
|
1303
1379
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1304
1380
|
case 70:
|
|
1305
1381
|
case "end":
|
|
1306
|
-
return
|
|
1382
|
+
return _context28.stop();
|
|
1307
1383
|
}
|
|
1308
|
-
},
|
|
1384
|
+
}, _callee28);
|
|
1309
1385
|
})));
|
|
1310
|
-
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1386
|
+
it('successfully handles out of order events when ROAP OK is received while executing outgoingRoapAnswer', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
|
|
1311
1387
|
var mockStatusBody, statusPayload, dummyEvent, postMediaSpy, dummyOkEvent, dummyOfferEvent;
|
|
1312
|
-
return _regenerator.default.wrap(function
|
|
1313
|
-
while (1) switch (
|
|
1388
|
+
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
1389
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1314
1390
|
case 0:
|
|
1315
1391
|
mockStatusBody = {
|
|
1316
1392
|
device: {
|
|
@@ -1350,7 +1426,7 @@ describe('State Machine handler tests', function () {
|
|
|
1350
1426
|
seq: 1,
|
|
1351
1427
|
messageType: 'ANSWER'
|
|
1352
1428
|
};
|
|
1353
|
-
|
|
1429
|
+
_context29.next = 18;
|
|
1354
1430
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1355
1431
|
case 18:
|
|
1356
1432
|
expect(postMediaSpy).toBeCalledOnceWith(dummyEvent.data);
|
|
@@ -1372,7 +1448,7 @@ describe('State Machine handler tests', function () {
|
|
|
1372
1448
|
seq: 2,
|
|
1373
1449
|
messageType: 'OFFER_REQUEST'
|
|
1374
1450
|
};
|
|
1375
|
-
|
|
1451
|
+
_context29.next = 24;
|
|
1376
1452
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1377
1453
|
case 24:
|
|
1378
1454
|
expect(call['receivedRoapOKSeq']).toBe(0);
|
|
@@ -1422,7 +1498,7 @@ describe('State Machine handler tests', function () {
|
|
|
1422
1498
|
};
|
|
1423
1499
|
call.sendCallStateMachineEvt(dummyEvent);
|
|
1424
1500
|
dummyEvent.type = 'E_RECV_ROAP_OFFER';
|
|
1425
|
-
|
|
1501
|
+
_context29.next = 50;
|
|
1426
1502
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1427
1503
|
case 50:
|
|
1428
1504
|
expect(_testUtil.mediaConnection.roapMessageReceived).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1431,7 +1507,7 @@ describe('State Machine handler tests', function () {
|
|
|
1431
1507
|
seq: 3,
|
|
1432
1508
|
messageType: 'ANSWER'
|
|
1433
1509
|
};
|
|
1434
|
-
|
|
1510
|
+
_context29.next = 55;
|
|
1435
1511
|
return call.sendMediaStateMachineEvt(dummyEvent);
|
|
1436
1512
|
case 55:
|
|
1437
1513
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
@@ -1448,7 +1524,7 @@ describe('State Machine handler tests', function () {
|
|
|
1448
1524
|
}
|
|
1449
1525
|
};
|
|
1450
1526
|
call.sendMediaStateMachineEvt(dummyEvent);
|
|
1451
|
-
|
|
1527
|
+
_context29.next = 62;
|
|
1452
1528
|
return call.sendMediaStateMachineEvt(dummyOkEvent);
|
|
1453
1529
|
case 62:
|
|
1454
1530
|
expect(call['receivedRoapOKSeq']).toBe(3);
|
|
@@ -1464,14 +1540,14 @@ describe('State Machine handler tests', function () {
|
|
|
1464
1540
|
expect(postMediaSpy).toHaveBeenLastCalledWith(dummyEvent.data);
|
|
1465
1541
|
case 70:
|
|
1466
1542
|
case "end":
|
|
1467
|
-
return
|
|
1543
|
+
return _context29.stop();
|
|
1468
1544
|
}
|
|
1469
|
-
},
|
|
1545
|
+
}, _callee29);
|
|
1470
1546
|
})));
|
|
1471
|
-
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1547
|
+
it('handle hold event successfully when media received after progress but before connect', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1472
1548
|
var statusPayload, dummyEvent, postMediaSpy, infoSpy, dummyOkEvent;
|
|
1473
|
-
return _regenerator.default.wrap(function
|
|
1474
|
-
while (1) switch (
|
|
1549
|
+
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
1550
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1475
1551
|
case 0:
|
|
1476
1552
|
statusPayload = {
|
|
1477
1553
|
statusCode: 200,
|
|
@@ -1538,9 +1614,9 @@ describe('State Machine handler tests', function () {
|
|
|
1538
1614
|
});
|
|
1539
1615
|
case 33:
|
|
1540
1616
|
case "end":
|
|
1541
|
-
return
|
|
1617
|
+
return _context30.stop();
|
|
1542
1618
|
}
|
|
1543
|
-
},
|
|
1619
|
+
}, _callee30);
|
|
1544
1620
|
})));
|
|
1545
1621
|
});
|
|
1546
1622
|
describe('Supplementary Services tests', function () {
|
|
@@ -1599,10 +1675,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1599
1675
|
beforeEach(function () {
|
|
1600
1676
|
call.removeAllListeners();
|
|
1601
1677
|
});
|
|
1602
|
-
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1678
|
+
it('Handle successful Call hold case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
|
|
1603
1679
|
var responsePayload, warnSpy, roapEvent;
|
|
1604
|
-
return _regenerator.default.wrap(function
|
|
1605
|
-
while (1) switch (
|
|
1680
|
+
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
1681
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1606
1682
|
case 0:
|
|
1607
1683
|
expect.assertions(7);
|
|
1608
1684
|
responsePayload = {
|
|
@@ -1615,25 +1691,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1615
1691
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1616
1692
|
call['held'] = false;
|
|
1617
1693
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1618
|
-
var
|
|
1619
|
-
return _regenerator.default.wrap(function
|
|
1620
|
-
while (1) switch (
|
|
1694
|
+
var _ref32 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(correlationId) {
|
|
1695
|
+
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
1696
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1621
1697
|
case 0:
|
|
1622
1698
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1623
1699
|
case 1:
|
|
1624
1700
|
case "end":
|
|
1625
|
-
return
|
|
1701
|
+
return _context31.stop();
|
|
1626
1702
|
}
|
|
1627
|
-
},
|
|
1703
|
+
}, _callee31);
|
|
1628
1704
|
}));
|
|
1629
1705
|
return function (_x) {
|
|
1630
|
-
return
|
|
1706
|
+
return _ref32.apply(this, arguments);
|
|
1631
1707
|
};
|
|
1632
1708
|
}());
|
|
1633
|
-
|
|
1709
|
+
_context32.next = 10;
|
|
1634
1710
|
return call.doHoldResume();
|
|
1635
1711
|
case 10:
|
|
1636
|
-
|
|
1712
|
+
_context32.next = 12;
|
|
1637
1713
|
return (0, _testUtil.flushPromises)(2);
|
|
1638
1714
|
case 12:
|
|
1639
1715
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1649,11 +1725,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1649
1725
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1650
1726
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1651
1727
|
roapEvent.data.type = 'ANSWER';
|
|
1652
|
-
|
|
1728
|
+
_context32.next = 20;
|
|
1653
1729
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1654
1730
|
case 20:
|
|
1655
1731
|
roapEvent.data.type = 'OK';
|
|
1656
|
-
|
|
1732
|
+
_context32.next = 23;
|
|
1657
1733
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1658
1734
|
case 23:
|
|
1659
1735
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1668,14 +1744,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1668
1744
|
});
|
|
1669
1745
|
case 28:
|
|
1670
1746
|
case "end":
|
|
1671
|
-
return
|
|
1747
|
+
return _context32.stop();
|
|
1672
1748
|
}
|
|
1673
|
-
},
|
|
1749
|
+
}, _callee32);
|
|
1674
1750
|
})));
|
|
1675
|
-
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1751
|
+
it('Handle successful Call hold case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34() {
|
|
1676
1752
|
var responsePayload, warnSpy, roapEvent;
|
|
1677
|
-
return _regenerator.default.wrap(function
|
|
1678
|
-
while (1) switch (
|
|
1753
|
+
return _regenerator.default.wrap(function _callee34$(_context34) {
|
|
1754
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1679
1755
|
case 0:
|
|
1680
1756
|
expect.assertions(8);
|
|
1681
1757
|
responsePayload = {
|
|
@@ -1688,26 +1764,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1688
1764
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1689
1765
|
call['held'] = false;
|
|
1690
1766
|
call.on(_types2.CALL_EVENT_KEYS.HELD, /*#__PURE__*/function () {
|
|
1691
|
-
var
|
|
1692
|
-
return _regenerator.default.wrap(function
|
|
1693
|
-
while (1) switch (
|
|
1767
|
+
var _ref34 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(correlationId) {
|
|
1768
|
+
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
1769
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1694
1770
|
case 0:
|
|
1695
1771
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
1696
1772
|
case 1:
|
|
1697
1773
|
case "end":
|
|
1698
|
-
return
|
|
1774
|
+
return _context33.stop();
|
|
1699
1775
|
}
|
|
1700
|
-
},
|
|
1776
|
+
}, _callee33);
|
|
1701
1777
|
}));
|
|
1702
1778
|
return function (_x2) {
|
|
1703
|
-
return
|
|
1779
|
+
return _ref34.apply(this, arguments);
|
|
1704
1780
|
};
|
|
1705
1781
|
}());
|
|
1706
1782
|
call.doHoldResume();
|
|
1707
|
-
|
|
1783
|
+
_context34.next = 11;
|
|
1708
1784
|
return _promise.default.resolve();
|
|
1709
1785
|
case 11:
|
|
1710
|
-
|
|
1786
|
+
_context34.next = 13;
|
|
1711
1787
|
return _promise.default.resolve();
|
|
1712
1788
|
case 13:
|
|
1713
1789
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -1723,11 +1799,11 @@ describe('Supplementary Services tests', function () {
|
|
|
1723
1799
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1724
1800
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1725
1801
|
roapEvent.data.type = 'ANSWER';
|
|
1726
|
-
|
|
1802
|
+
_context34.next = 22;
|
|
1727
1803
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1728
1804
|
case 22:
|
|
1729
1805
|
roapEvent.data.type = 'OK';
|
|
1730
|
-
|
|
1806
|
+
_context34.next = 25;
|
|
1731
1807
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1732
1808
|
case 25:
|
|
1733
1809
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -1742,14 +1818,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1742
1818
|
});
|
|
1743
1819
|
case 30:
|
|
1744
1820
|
case "end":
|
|
1745
|
-
return
|
|
1821
|
+
return _context34.stop();
|
|
1746
1822
|
}
|
|
1747
|
-
},
|
|
1823
|
+
}, _callee34);
|
|
1748
1824
|
})));
|
|
1749
|
-
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1825
|
+
it('Handle failure Call Hold case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
|
|
1750
1826
|
var responsePayload;
|
|
1751
|
-
return _regenerator.default.wrap(function
|
|
1752
|
-
while (1) switch (
|
|
1827
|
+
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
1828
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1753
1829
|
case 0:
|
|
1754
1830
|
expect.assertions(4);
|
|
1755
1831
|
responsePayload = {
|
|
@@ -1759,26 +1835,26 @@ describe('Supplementary Services tests', function () {
|
|
|
1759
1835
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
1760
1836
|
call['held'] = false;
|
|
1761
1837
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1762
|
-
var
|
|
1763
|
-
return _regenerator.default.wrap(function
|
|
1764
|
-
while (1) switch (
|
|
1838
|
+
var _ref36 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(errObj) {
|
|
1839
|
+
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
1840
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1765
1841
|
case 0:
|
|
1766
1842
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
1767
1843
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
1768
1844
|
case 2:
|
|
1769
1845
|
case "end":
|
|
1770
|
-
return
|
|
1846
|
+
return _context35.stop();
|
|
1771
1847
|
}
|
|
1772
|
-
},
|
|
1848
|
+
}, _callee35);
|
|
1773
1849
|
}));
|
|
1774
1850
|
return function (_x3) {
|
|
1775
|
-
return
|
|
1851
|
+
return _ref36.apply(this, arguments);
|
|
1776
1852
|
};
|
|
1777
1853
|
}());
|
|
1778
|
-
|
|
1854
|
+
_context36.next = 7;
|
|
1779
1855
|
return call.doHoldResume();
|
|
1780
1856
|
case 7:
|
|
1781
|
-
|
|
1857
|
+
_context36.next = 9;
|
|
1782
1858
|
return (0, _testUtil.flushPromises)(2);
|
|
1783
1859
|
case 9:
|
|
1784
1860
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -1788,14 +1864,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1788
1864
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1789
1865
|
case 11:
|
|
1790
1866
|
case "end":
|
|
1791
|
-
return
|
|
1867
|
+
return _context36.stop();
|
|
1792
1868
|
}
|
|
1793
|
-
},
|
|
1869
|
+
}, _callee36);
|
|
1794
1870
|
})));
|
|
1795
|
-
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1871
|
+
it('Handle failure Call Hold case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
1796
1872
|
var responsePayload, rejectPayload, roapEvent;
|
|
1797
|
-
return _regenerator.default.wrap(function
|
|
1798
|
-
while (1) switch (
|
|
1873
|
+
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
1874
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1799
1875
|
case 0:
|
|
1800
1876
|
expect.assertions(5);
|
|
1801
1877
|
responsePayload = {
|
|
@@ -1809,24 +1885,24 @@ describe('Supplementary Services tests', function () {
|
|
|
1809
1885
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
1810
1886
|
call['held'] = false;
|
|
1811
1887
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1812
|
-
var
|
|
1813
|
-
return _regenerator.default.wrap(function
|
|
1814
|
-
while (1) switch (
|
|
1888
|
+
var _ref38 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(errObj) {
|
|
1889
|
+
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
1890
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1815
1891
|
case 0:
|
|
1816
1892
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
1817
1893
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
1818
1894
|
case 2:
|
|
1819
1895
|
case "end":
|
|
1820
|
-
return
|
|
1896
|
+
return _context37.stop();
|
|
1821
1897
|
}
|
|
1822
|
-
},
|
|
1898
|
+
}, _callee37);
|
|
1823
1899
|
}));
|
|
1824
1900
|
return function (_x4) {
|
|
1825
|
-
return
|
|
1901
|
+
return _ref38.apply(this, arguments);
|
|
1826
1902
|
};
|
|
1827
1903
|
}());
|
|
1828
1904
|
call.doHoldResume();
|
|
1829
|
-
|
|
1905
|
+
_context38.next = 9;
|
|
1830
1906
|
return (0, _testUtil.flushPromises)(2);
|
|
1831
1907
|
case 9:
|
|
1832
1908
|
/* the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -1836,7 +1912,7 @@ describe('Supplementary Services tests', function () {
|
|
|
1836
1912
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1837
1913
|
/* We are intentionally failing the ROAP ANSWER */
|
|
1838
1914
|
roapEvent.data.type = 'ANSWER';
|
|
1839
|
-
|
|
1915
|
+
_context38.next = 15;
|
|
1840
1916
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1841
1917
|
case 15:
|
|
1842
1918
|
expect(call.isHeld()).toStrictEqual(false);
|
|
@@ -1844,14 +1920,14 @@ describe('Supplementary Services tests', function () {
|
|
|
1844
1920
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1845
1921
|
case 17:
|
|
1846
1922
|
case "end":
|
|
1847
|
-
return
|
|
1923
|
+
return _context38.stop();
|
|
1848
1924
|
}
|
|
1849
|
-
},
|
|
1925
|
+
}, _callee38);
|
|
1850
1926
|
})));
|
|
1851
|
-
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1927
|
+
it('Handle failure Call Hold case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
|
|
1852
1928
|
var responsePayload, warnSpy, roapEvent;
|
|
1853
|
-
return _regenerator.default.wrap(function
|
|
1854
|
-
while (1) switch (
|
|
1929
|
+
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
1930
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1855
1931
|
case 0:
|
|
1856
1932
|
responsePayload = {
|
|
1857
1933
|
statusCode: 200,
|
|
@@ -1862,10 +1938,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1862
1938
|
jest.spyOn(global, 'clearTimeout');
|
|
1863
1939
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1864
1940
|
call['held'] = false;
|
|
1865
|
-
|
|
1941
|
+
_context39.next = 8;
|
|
1866
1942
|
return call.doHoldResume();
|
|
1867
1943
|
case 8:
|
|
1868
|
-
|
|
1944
|
+
_context39.next = 10;
|
|
1869
1945
|
return (0, _testUtil.flushPromises)(2);
|
|
1870
1946
|
case 10:
|
|
1871
1947
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1880,38 +1956,38 @@ describe('Supplementary Services tests', function () {
|
|
|
1880
1956
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1881
1957
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1882
1958
|
roapEvent.data.type = 'ANSWER';
|
|
1883
|
-
|
|
1959
|
+
_context39.next = 17;
|
|
1884
1960
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1885
1961
|
case 17:
|
|
1886
1962
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
1887
1963
|
statusCode: 403
|
|
1888
1964
|
});
|
|
1889
1965
|
roapEvent.data.type = 'OK';
|
|
1890
|
-
|
|
1966
|
+
_context39.next = 21;
|
|
1891
1967
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1892
1968
|
case 21:
|
|
1893
1969
|
/* this is for coverage */
|
|
1894
1970
|
call['callStateMachine'].state.value = 'S_CALL_HOLD';
|
|
1895
|
-
|
|
1971
|
+
_context39.next = 24;
|
|
1896
1972
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1897
1973
|
case 24:
|
|
1898
1974
|
expect(call.isHeld()).toStrictEqual(false);
|
|
1899
1975
|
/* We should return back to call established state */
|
|
1900
1976
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1901
|
-
expect(warnSpy).toHaveBeenCalledWith('
|
|
1977
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1902
1978
|
file: 'call',
|
|
1903
1979
|
method: 'handleRoapEstablished'
|
|
1904
1980
|
});
|
|
1905
1981
|
case 27:
|
|
1906
1982
|
case "end":
|
|
1907
|
-
return
|
|
1983
|
+
return _context39.stop();
|
|
1908
1984
|
}
|
|
1909
|
-
},
|
|
1985
|
+
}, _callee39);
|
|
1910
1986
|
})));
|
|
1911
|
-
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
1987
|
+
it('Handle failure Call resume case during roap ok out', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
|
|
1912
1988
|
var responsePayload, warnSpy, roapEvent;
|
|
1913
|
-
return _regenerator.default.wrap(function
|
|
1914
|
-
while (1) switch (
|
|
1989
|
+
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
1990
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1915
1991
|
case 0:
|
|
1916
1992
|
responsePayload = {
|
|
1917
1993
|
statusCode: 200,
|
|
@@ -1922,10 +1998,10 @@ describe('Supplementary Services tests', function () {
|
|
|
1922
1998
|
jest.spyOn(global, 'clearTimeout');
|
|
1923
1999
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
1924
2000
|
call['held'] = true;
|
|
1925
|
-
|
|
2001
|
+
_context40.next = 8;
|
|
1926
2002
|
return call.doHoldResume();
|
|
1927
2003
|
case 8:
|
|
1928
|
-
|
|
2004
|
+
_context40.next = 10;
|
|
1929
2005
|
return (0, _testUtil.flushPromises)(2);
|
|
1930
2006
|
case 10:
|
|
1931
2007
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -1940,33 +2016,33 @@ describe('Supplementary Services tests', function () {
|
|
|
1940
2016
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
1941
2017
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
1942
2018
|
roapEvent.data.type = 'ANSWER';
|
|
1943
|
-
|
|
2019
|
+
_context40.next = 17;
|
|
1944
2020
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
1945
2021
|
case 17:
|
|
1946
2022
|
jest.spyOn(webex, 'request').mockRejectedValue({
|
|
1947
2023
|
statusCode: 403
|
|
1948
2024
|
});
|
|
1949
2025
|
roapEvent.data.type = 'OK';
|
|
1950
|
-
|
|
2026
|
+
_context40.next = 21;
|
|
1951
2027
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
1952
2028
|
case 21:
|
|
1953
2029
|
expect(call.isHeld()).toStrictEqual(true);
|
|
1954
2030
|
/* We should return back to call established state */
|
|
1955
2031
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
1956
|
-
expect(warnSpy).toHaveBeenCalledWith('
|
|
2032
|
+
expect(warnSpy).toHaveBeenCalledWith('Failed to process MediaOk request', {
|
|
1957
2033
|
file: 'call',
|
|
1958
2034
|
method: 'handleRoapEstablished'
|
|
1959
2035
|
});
|
|
1960
2036
|
case 24:
|
|
1961
2037
|
case "end":
|
|
1962
|
-
return
|
|
2038
|
+
return _context40.stop();
|
|
1963
2039
|
}
|
|
1964
|
-
},
|
|
2040
|
+
}, _callee40);
|
|
1965
2041
|
})));
|
|
1966
|
-
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2042
|
+
it('Handle Call hold case where successful Held response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
1967
2043
|
var responsePayload, roapEvent;
|
|
1968
|
-
return _regenerator.default.wrap(function
|
|
1969
|
-
while (1) switch (
|
|
2044
|
+
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
2045
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
1970
2046
|
case 0:
|
|
1971
2047
|
expect.assertions(5);
|
|
1972
2048
|
responsePayload = {
|
|
@@ -1976,25 +2052,25 @@ describe('Supplementary Services tests', function () {
|
|
|
1976
2052
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
1977
2053
|
call['held'] = false;
|
|
1978
2054
|
call.on(_types2.CALL_EVENT_KEYS.HOLD_ERROR, /*#__PURE__*/function () {
|
|
1979
|
-
var
|
|
1980
|
-
return _regenerator.default.wrap(function
|
|
1981
|
-
while (1) switch (
|
|
2055
|
+
var _ref42 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(errObj) {
|
|
2056
|
+
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
2057
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
1982
2058
|
case 0:
|
|
1983
2059
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
1984
2060
|
expect(errObj.message).toStrictEqual('An error occurred while placing the call on hold. Wait a moment and try again.');
|
|
1985
2061
|
case 2:
|
|
1986
2062
|
case "end":
|
|
1987
|
-
return
|
|
2063
|
+
return _context41.stop();
|
|
1988
2064
|
}
|
|
1989
|
-
},
|
|
2065
|
+
}, _callee41);
|
|
1990
2066
|
}));
|
|
1991
2067
|
return function (_x5) {
|
|
1992
|
-
return
|
|
2068
|
+
return _ref42.apply(this, arguments);
|
|
1993
2069
|
};
|
|
1994
2070
|
}());
|
|
1995
2071
|
jest.runAllTimers();
|
|
1996
2072
|
call.doHoldResume();
|
|
1997
|
-
|
|
2073
|
+
_context42.next = 9;
|
|
1998
2074
|
return (0, _testUtil.flushPromises)(2);
|
|
1999
2075
|
case 9:
|
|
2000
2076
|
/* At this point, the Call State should be S_CALL_HOLD
|
|
@@ -2007,11 +2083,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2007
2083
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2008
2084
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2009
2085
|
roapEvent.data.type = 'ANSWER';
|
|
2010
|
-
|
|
2086
|
+
_context42.next = 15;
|
|
2011
2087
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2012
2088
|
case 15:
|
|
2013
2089
|
roapEvent.data.type = 'OK';
|
|
2014
|
-
|
|
2090
|
+
_context42.next = 18;
|
|
2015
2091
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2016
2092
|
case 18:
|
|
2017
2093
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2023,14 +2099,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2023
2099
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2024
2100
|
case 21:
|
|
2025
2101
|
case "end":
|
|
2026
|
-
return
|
|
2102
|
+
return _context42.stop();
|
|
2027
2103
|
}
|
|
2028
|
-
},
|
|
2104
|
+
}, _callee42);
|
|
2029
2105
|
})));
|
|
2030
|
-
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2106
|
+
it('Handle successful Call Resume case without delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
|
|
2031
2107
|
var responsePayload, warnSpy, roapEvent;
|
|
2032
|
-
return _regenerator.default.wrap(function
|
|
2033
|
-
while (1) switch (
|
|
2108
|
+
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
2109
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
2034
2110
|
case 0:
|
|
2035
2111
|
expect.assertions(7);
|
|
2036
2112
|
responsePayload = {
|
|
@@ -2043,25 +2119,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2043
2119
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2044
2120
|
call['held'] = true;
|
|
2045
2121
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2046
|
-
var
|
|
2047
|
-
return _regenerator.default.wrap(function
|
|
2048
|
-
while (1) switch (
|
|
2122
|
+
var _ref44 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(correlationId) {
|
|
2123
|
+
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
2124
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
2049
2125
|
case 0:
|
|
2050
2126
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2051
2127
|
case 1:
|
|
2052
2128
|
case "end":
|
|
2053
|
-
return
|
|
2129
|
+
return _context43.stop();
|
|
2054
2130
|
}
|
|
2055
|
-
},
|
|
2131
|
+
}, _callee43);
|
|
2056
2132
|
}));
|
|
2057
2133
|
return function (_x6) {
|
|
2058
|
-
return
|
|
2134
|
+
return _ref44.apply(this, arguments);
|
|
2059
2135
|
};
|
|
2060
2136
|
}());
|
|
2061
|
-
|
|
2137
|
+
_context44.next = 10;
|
|
2062
2138
|
return call.doHoldResume();
|
|
2063
2139
|
case 10:
|
|
2064
|
-
|
|
2140
|
+
_context44.next = 12;
|
|
2065
2141
|
return (0, _testUtil.flushPromises)(2);
|
|
2066
2142
|
case 12:
|
|
2067
2143
|
expect(setTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2077,11 +2153,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2077
2153
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2078
2154
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2079
2155
|
roapEvent.data.type = 'ANSWER';
|
|
2080
|
-
|
|
2156
|
+
_context44.next = 20;
|
|
2081
2157
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2082
2158
|
case 20:
|
|
2083
2159
|
roapEvent.data.type = 'OK';
|
|
2084
|
-
|
|
2160
|
+
_context44.next = 23;
|
|
2085
2161
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2086
2162
|
case 23:
|
|
2087
2163
|
expect(clearTimeout).toHaveBeenCalledTimes(1);
|
|
@@ -2096,14 +2172,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2096
2172
|
});
|
|
2097
2173
|
case 28:
|
|
2098
2174
|
case "end":
|
|
2099
|
-
return
|
|
2175
|
+
return _context44.stop();
|
|
2100
2176
|
}
|
|
2101
|
-
},
|
|
2177
|
+
}, _callee44);
|
|
2102
2178
|
})));
|
|
2103
|
-
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2179
|
+
it('Handle successful Call Resume case with delayed http response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
|
|
2104
2180
|
var responsePayload, warnSpy, roapEvent;
|
|
2105
|
-
return _regenerator.default.wrap(function
|
|
2106
|
-
while (1) switch (
|
|
2181
|
+
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
2182
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
2107
2183
|
case 0:
|
|
2108
2184
|
expect.assertions(7);
|
|
2109
2185
|
responsePayload = {
|
|
@@ -2116,26 +2192,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2116
2192
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2117
2193
|
call['held'] = true;
|
|
2118
2194
|
call.on(_types2.CALL_EVENT_KEYS.RESUMED, /*#__PURE__*/function () {
|
|
2119
|
-
var
|
|
2120
|
-
return _regenerator.default.wrap(function
|
|
2121
|
-
while (1) switch (
|
|
2195
|
+
var _ref46 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45(correlationId) {
|
|
2196
|
+
return _regenerator.default.wrap(function _callee45$(_context45) {
|
|
2197
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
2122
2198
|
case 0:
|
|
2123
2199
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2124
2200
|
case 1:
|
|
2125
2201
|
case "end":
|
|
2126
|
-
return
|
|
2202
|
+
return _context45.stop();
|
|
2127
2203
|
}
|
|
2128
|
-
},
|
|
2204
|
+
}, _callee45);
|
|
2129
2205
|
}));
|
|
2130
2206
|
return function (_x7) {
|
|
2131
|
-
return
|
|
2207
|
+
return _ref46.apply(this, arguments);
|
|
2132
2208
|
};
|
|
2133
2209
|
}());
|
|
2134
2210
|
call.doHoldResume();
|
|
2135
|
-
|
|
2211
|
+
_context46.next = 11;
|
|
2136
2212
|
return _promise.default.resolve();
|
|
2137
2213
|
case 11:
|
|
2138
|
-
|
|
2214
|
+
_context46.next = 13;
|
|
2139
2215
|
return _promise.default.resolve();
|
|
2140
2216
|
case 13:
|
|
2141
2217
|
expect(setTimeout).not.toHaveBeenCalled();
|
|
@@ -2151,11 +2227,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2151
2227
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2152
2228
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2153
2229
|
roapEvent.data.type = 'ANSWER';
|
|
2154
|
-
|
|
2230
|
+
_context46.next = 21;
|
|
2155
2231
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2156
2232
|
case 21:
|
|
2157
2233
|
roapEvent.data.type = 'OK';
|
|
2158
|
-
|
|
2234
|
+
_context46.next = 24;
|
|
2159
2235
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2160
2236
|
case 24:
|
|
2161
2237
|
expect(clearTimeout).not.toHaveBeenCalled();
|
|
@@ -2170,14 +2246,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2170
2246
|
});
|
|
2171
2247
|
case 29:
|
|
2172
2248
|
case "end":
|
|
2173
|
-
return
|
|
2249
|
+
return _context46.stop();
|
|
2174
2250
|
}
|
|
2175
|
-
},
|
|
2251
|
+
}, _callee46);
|
|
2176
2252
|
})));
|
|
2177
|
-
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2253
|
+
it('Handle failure Call Resume case during signalling', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48() {
|
|
2178
2254
|
var responsePayload;
|
|
2179
|
-
return _regenerator.default.wrap(function
|
|
2180
|
-
while (1) switch (
|
|
2255
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
2256
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
2181
2257
|
case 0:
|
|
2182
2258
|
expect.assertions(4);
|
|
2183
2259
|
responsePayload = {
|
|
@@ -2187,26 +2263,26 @@ describe('Supplementary Services tests', function () {
|
|
|
2187
2263
|
jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2188
2264
|
call['held'] = true;
|
|
2189
2265
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2190
|
-
var
|
|
2191
|
-
return _regenerator.default.wrap(function
|
|
2192
|
-
while (1) switch (
|
|
2266
|
+
var _ref48 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47(errObj) {
|
|
2267
|
+
return _regenerator.default.wrap(function _callee47$(_context47) {
|
|
2268
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
2193
2269
|
case 0:
|
|
2194
2270
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2195
2271
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2196
2272
|
case 2:
|
|
2197
2273
|
case "end":
|
|
2198
|
-
return
|
|
2274
|
+
return _context47.stop();
|
|
2199
2275
|
}
|
|
2200
|
-
},
|
|
2276
|
+
}, _callee47);
|
|
2201
2277
|
}));
|
|
2202
2278
|
return function (_x8) {
|
|
2203
|
-
return
|
|
2279
|
+
return _ref48.apply(this, arguments);
|
|
2204
2280
|
};
|
|
2205
2281
|
}());
|
|
2206
|
-
|
|
2282
|
+
_context48.next = 7;
|
|
2207
2283
|
return call.doHoldResume();
|
|
2208
2284
|
case 7:
|
|
2209
|
-
|
|
2285
|
+
_context48.next = 9;
|
|
2210
2286
|
return (0, _testUtil.flushPromises)(2);
|
|
2211
2287
|
case 9:
|
|
2212
2288
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2217,14 +2293,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2217
2293
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2218
2294
|
case 11:
|
|
2219
2295
|
case "end":
|
|
2220
|
-
return
|
|
2296
|
+
return _context48.stop();
|
|
2221
2297
|
}
|
|
2222
|
-
},
|
|
2298
|
+
}, _callee48);
|
|
2223
2299
|
})));
|
|
2224
|
-
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2300
|
+
it('Handle failure Call Resume case during offer/answer exchange', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
|
|
2225
2301
|
var responsePayload, rejectPayload, roapEvent;
|
|
2226
|
-
return _regenerator.default.wrap(function
|
|
2227
|
-
while (1) switch (
|
|
2302
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
2303
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
2228
2304
|
case 0:
|
|
2229
2305
|
expect.assertions(5);
|
|
2230
2306
|
responsePayload = {
|
|
@@ -2238,24 +2314,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2238
2314
|
jest.spyOn(webex, 'request').mockResolvedValueOnce(responsePayload).mockRejectedValueOnce(rejectPayload);
|
|
2239
2315
|
call['held'] = true;
|
|
2240
2316
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2241
|
-
var
|
|
2242
|
-
return _regenerator.default.wrap(function
|
|
2243
|
-
while (1) switch (
|
|
2317
|
+
var _ref50 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(errObj) {
|
|
2318
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
2319
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
2244
2320
|
case 0:
|
|
2245
2321
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.SERVICE_UNAVAILABLE);
|
|
2246
2322
|
expect(errObj.message).toStrictEqual('An unknown error occurred. Wait a moment and try again.');
|
|
2247
2323
|
case 2:
|
|
2248
2324
|
case "end":
|
|
2249
|
-
return
|
|
2325
|
+
return _context49.stop();
|
|
2250
2326
|
}
|
|
2251
|
-
},
|
|
2327
|
+
}, _callee49);
|
|
2252
2328
|
}));
|
|
2253
2329
|
return function (_x9) {
|
|
2254
|
-
return
|
|
2330
|
+
return _ref50.apply(this, arguments);
|
|
2255
2331
|
};
|
|
2256
2332
|
}());
|
|
2257
2333
|
call.doHoldResume();
|
|
2258
|
-
|
|
2334
|
+
_context50.next = 9;
|
|
2259
2335
|
return (0, _testUtil.flushPromises)(2);
|
|
2260
2336
|
case 9:
|
|
2261
2337
|
/* At this point , the Call State should transition to S_CALL_ESTABLISHED
|
|
@@ -2266,7 +2342,7 @@ describe('Supplementary Services tests', function () {
|
|
|
2266
2342
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2267
2343
|
/* We are intentionally failing the ROAP ANSWER */
|
|
2268
2344
|
roapEvent.data.type = 'ANSWER';
|
|
2269
|
-
|
|
2345
|
+
_context50.next = 15;
|
|
2270
2346
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2271
2347
|
case 15:
|
|
2272
2348
|
expect(call.isHeld()).toStrictEqual(true);
|
|
@@ -2274,14 +2350,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2274
2350
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2275
2351
|
case 17:
|
|
2276
2352
|
case "end":
|
|
2277
|
-
return
|
|
2353
|
+
return _context50.stop();
|
|
2278
2354
|
}
|
|
2279
|
-
},
|
|
2355
|
+
}, _callee50);
|
|
2280
2356
|
})));
|
|
2281
|
-
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2357
|
+
it('Handle Call resume case where successful response does not come', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
2282
2358
|
var responsePayload, roapEvent;
|
|
2283
|
-
return _regenerator.default.wrap(function
|
|
2284
|
-
while (1) switch (
|
|
2359
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
2360
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
2285
2361
|
case 0:
|
|
2286
2362
|
expect.assertions(5);
|
|
2287
2363
|
responsePayload = {
|
|
@@ -2291,24 +2367,24 @@ describe('Supplementary Services tests', function () {
|
|
|
2291
2367
|
jest.spyOn(webex, 'request').mockResolvedValue(responsePayload);
|
|
2292
2368
|
call['held'] = true;
|
|
2293
2369
|
call.on(_types2.CALL_EVENT_KEYS.RESUME_ERROR, /*#__PURE__*/function () {
|
|
2294
|
-
var
|
|
2295
|
-
return _regenerator.default.wrap(function
|
|
2296
|
-
while (1) switch (
|
|
2370
|
+
var _ref52 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51(errObj) {
|
|
2371
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
2372
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
2297
2373
|
case 0:
|
|
2298
2374
|
expect(errObj.type).toStrictEqual(_types.ERROR_TYPE.TIMEOUT);
|
|
2299
2375
|
expect(errObj.message).toStrictEqual('An error occurred while resuming the call. Wait a moment and try again.');
|
|
2300
2376
|
case 2:
|
|
2301
2377
|
case "end":
|
|
2302
|
-
return
|
|
2378
|
+
return _context51.stop();
|
|
2303
2379
|
}
|
|
2304
|
-
},
|
|
2380
|
+
}, _callee51);
|
|
2305
2381
|
}));
|
|
2306
2382
|
return function (_x10) {
|
|
2307
|
-
return
|
|
2383
|
+
return _ref52.apply(this, arguments);
|
|
2308
2384
|
};
|
|
2309
2385
|
}());
|
|
2310
2386
|
call.doHoldResume();
|
|
2311
|
-
|
|
2387
|
+
_context52.next = 8;
|
|
2312
2388
|
return (0, _testUtil.flushPromises)(2);
|
|
2313
2389
|
case 8:
|
|
2314
2390
|
/* At this point ,the Call State should be S_CALL_RESUME
|
|
@@ -2321,11 +2397,11 @@ describe('Supplementary Services tests', function () {
|
|
|
2321
2397
|
call['handleIncomingRoapOffer']({}, dummyEvent);
|
|
2322
2398
|
roapEvent = JSON.parse((0, _stringify.default)(dummyEvent));
|
|
2323
2399
|
roapEvent.data.type = 'ANSWER';
|
|
2324
|
-
|
|
2400
|
+
_context52.next = 14;
|
|
2325
2401
|
return call['handleOutgoingRoapAnswer']({}, dummyEvent);
|
|
2326
2402
|
case 14:
|
|
2327
2403
|
roapEvent.data.type = 'OK';
|
|
2328
|
-
|
|
2404
|
+
_context52.next = 17;
|
|
2329
2405
|
return call['handleRoapEstablished']({}, dummyEvent);
|
|
2330
2406
|
case 17:
|
|
2331
2407
|
/* Advancing timer by 12 seconds so that it gets timed out */
|
|
@@ -2335,9 +2411,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2335
2411
|
expect(call['callStateMachine'].state.value).toStrictEqual('S_CALL_ESTABLISHED');
|
|
2336
2412
|
case 20:
|
|
2337
2413
|
case "end":
|
|
2338
|
-
return
|
|
2414
|
+
return _context52.stop();
|
|
2339
2415
|
}
|
|
2340
|
-
},
|
|
2416
|
+
}, _callee52);
|
|
2341
2417
|
})));
|
|
2342
2418
|
});
|
|
2343
2419
|
describe('Call transfer tests', function () {
|
|
@@ -2369,10 +2445,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2369
2445
|
secondCall.removeAllListeners(_types2.CALL_EVENT_KEYS.CALL_ERROR);
|
|
2370
2446
|
secondCall['held'] = false;
|
|
2371
2447
|
});
|
|
2372
|
-
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2448
|
+
it('Handle successful consult transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
|
|
2373
2449
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2374
|
-
return _regenerator.default.wrap(function
|
|
2375
|
-
while (1) switch (
|
|
2450
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
2451
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
2376
2452
|
case 0:
|
|
2377
2453
|
expect.assertions(9);
|
|
2378
2454
|
responsePayload = {
|
|
@@ -2384,41 +2460,41 @@ describe('Supplementary Services tests', function () {
|
|
|
2384
2460
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2385
2461
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2386
2462
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2387
|
-
var
|
|
2388
|
-
return _regenerator.default.wrap(function
|
|
2389
|
-
while (1) switch (
|
|
2463
|
+
var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(correlationId) {
|
|
2464
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
2465
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
2390
2466
|
case 0:
|
|
2391
2467
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2392
2468
|
case 1:
|
|
2393
2469
|
case "end":
|
|
2394
|
-
return
|
|
2470
|
+
return _context53.stop();
|
|
2395
2471
|
}
|
|
2396
|
-
},
|
|
2472
|
+
}, _callee53);
|
|
2397
2473
|
}));
|
|
2398
2474
|
return function (_x11) {
|
|
2399
|
-
return
|
|
2475
|
+
return _ref54.apply(this, arguments);
|
|
2400
2476
|
};
|
|
2401
2477
|
}());
|
|
2402
2478
|
secondCall.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2403
|
-
var
|
|
2404
|
-
return _regenerator.default.wrap(function
|
|
2405
|
-
while (1) switch (
|
|
2479
|
+
var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(correlationId) {
|
|
2480
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
2481
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
2406
2482
|
case 0:
|
|
2407
2483
|
expect(correlationId).toStrictEqual(secondCall.getCorrelationId());
|
|
2408
2484
|
case 1:
|
|
2409
2485
|
case "end":
|
|
2410
|
-
return
|
|
2486
|
+
return _context54.stop();
|
|
2411
2487
|
}
|
|
2412
|
-
},
|
|
2488
|
+
}, _callee54);
|
|
2413
2489
|
}));
|
|
2414
2490
|
return function (_x12) {
|
|
2415
|
-
return
|
|
2491
|
+
return _ref55.apply(this, arguments);
|
|
2416
2492
|
};
|
|
2417
2493
|
}());
|
|
2418
|
-
|
|
2494
|
+
_context55.next = 10;
|
|
2419
2495
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2420
2496
|
case 10:
|
|
2421
|
-
|
|
2497
|
+
_context55.next = 12;
|
|
2422
2498
|
return (0, _testUtil.flushPromises)(2);
|
|
2423
2499
|
case 12:
|
|
2424
2500
|
expect(requestSpy).toBeCalled();
|
|
@@ -2438,14 +2514,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2438
2514
|
expect(warnSpy).not.toHaveBeenCalledWith("Consult Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2439
2515
|
case 21:
|
|
2440
2516
|
case "end":
|
|
2441
|
-
return
|
|
2517
|
+
return _context55.stop();
|
|
2442
2518
|
}
|
|
2443
|
-
},
|
|
2519
|
+
}, _callee55);
|
|
2444
2520
|
})));
|
|
2445
|
-
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2521
|
+
it('Handle successful blind transfer case ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57() {
|
|
2446
2522
|
var responsePayload, requestSpy, warnSpy, infoSpy, metricSpy;
|
|
2447
|
-
return _regenerator.default.wrap(function
|
|
2448
|
-
while (1) switch (
|
|
2523
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
2524
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2449
2525
|
case 0:
|
|
2450
2526
|
expect.assertions(7);
|
|
2451
2527
|
responsePayload = {
|
|
@@ -2457,25 +2533,25 @@ describe('Supplementary Services tests', function () {
|
|
|
2457
2533
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
2458
2534
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2459
2535
|
call.on(_types2.CALL_EVENT_KEYS.DISCONNECT, /*#__PURE__*/function () {
|
|
2460
|
-
var
|
|
2461
|
-
return _regenerator.default.wrap(function
|
|
2462
|
-
while (1) switch (
|
|
2536
|
+
var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(correlationId) {
|
|
2537
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
2538
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
2463
2539
|
case 0:
|
|
2464
2540
|
expect(correlationId).toStrictEqual(call.getCorrelationId());
|
|
2465
2541
|
case 1:
|
|
2466
2542
|
case "end":
|
|
2467
|
-
return
|
|
2543
|
+
return _context56.stop();
|
|
2468
2544
|
}
|
|
2469
|
-
},
|
|
2545
|
+
}, _callee56);
|
|
2470
2546
|
}));
|
|
2471
2547
|
return function (_x13) {
|
|
2472
|
-
return
|
|
2548
|
+
return _ref57.apply(this, arguments);
|
|
2473
2549
|
};
|
|
2474
2550
|
}());
|
|
2475
|
-
|
|
2551
|
+
_context57.next = 9;
|
|
2476
2552
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2477
2553
|
case 9:
|
|
2478
|
-
|
|
2554
|
+
_context57.next = 11;
|
|
2479
2555
|
return (0, _testUtil.flushPromises)(2);
|
|
2480
2556
|
case 11:
|
|
2481
2557
|
expect(requestSpy).toBeCalled();
|
|
@@ -2491,14 +2567,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2491
2567
|
expect(warnSpy).not.toHaveBeenCalledWith("Blind Transfer failed for correlationId ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2492
2568
|
case 18:
|
|
2493
2569
|
case "end":
|
|
2494
|
-
return
|
|
2570
|
+
return _context57.stop();
|
|
2495
2571
|
}
|
|
2496
|
-
},
|
|
2572
|
+
}, _callee57);
|
|
2497
2573
|
})));
|
|
2498
|
-
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2574
|
+
it('Handle unsuccessful blind transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58() {
|
|
2499
2575
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2500
|
-
return _regenerator.default.wrap(function
|
|
2501
|
-
while (1) switch (
|
|
2576
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
2577
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2502
2578
|
case 0:
|
|
2503
2579
|
responsePayload = {
|
|
2504
2580
|
statusCode: 403,
|
|
@@ -2508,10 +2584,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2508
2584
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2509
2585
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2510
2586
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2511
|
-
|
|
2587
|
+
_context58.next = 7;
|
|
2512
2588
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, transfereeNumber);
|
|
2513
2589
|
case 7:
|
|
2514
|
-
|
|
2590
|
+
_context58.next = 9;
|
|
2515
2591
|
return (0, _testUtil.flushPromises)(1);
|
|
2516
2592
|
case 9:
|
|
2517
2593
|
expect(requestSpy).toBeCalled();
|
|
@@ -2527,14 +2603,14 @@ describe('Supplementary Services tests', function () {
|
|
|
2527
2603
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.BLIND, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
2528
2604
|
case 16:
|
|
2529
2605
|
case "end":
|
|
2530
|
-
return
|
|
2606
|
+
return _context58.stop();
|
|
2531
2607
|
}
|
|
2532
|
-
},
|
|
2608
|
+
}, _callee58);
|
|
2533
2609
|
})));
|
|
2534
|
-
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2610
|
+
it('Handle unsuccessful consult transfer case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59() {
|
|
2535
2611
|
var responsePayload, emitSpy, requestSpy, warnSpy, metricSpy;
|
|
2536
|
-
return _regenerator.default.wrap(function
|
|
2537
|
-
while (1) switch (
|
|
2612
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
2613
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2538
2614
|
case 0:
|
|
2539
2615
|
responsePayload = {
|
|
2540
2616
|
statusCode: 403,
|
|
@@ -2544,10 +2620,10 @@ describe('Supplementary Services tests', function () {
|
|
|
2544
2620
|
requestSpy = jest.spyOn(webex, 'request').mockRejectedValue(responsePayload);
|
|
2545
2621
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2546
2622
|
metricSpy = jest.spyOn(call['metricManager'], 'submitCallMetric');
|
|
2547
|
-
|
|
2623
|
+
_context59.next = 7;
|
|
2548
2624
|
return call.completeTransfer(_types5.TransferType.CONSULT, secondCall.getCallId(), undefined);
|
|
2549
2625
|
case 7:
|
|
2550
|
-
|
|
2626
|
+
_context59.next = 9;
|
|
2551
2627
|
return (0, _testUtil.flushPromises)(2);
|
|
2552
2628
|
case 9:
|
|
2553
2629
|
expect(requestSpy).toBeCalled();
|
|
@@ -2564,18 +2640,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2564
2640
|
expect(metricSpy).toHaveBeenCalledWith(_types4.METRIC_EVENT.CALL_ERROR, _types4.TRANSFER_ACTION.CONSULT, _types4.METRIC_TYPE.BEHAVIORAL, call.getCallId(), call.getCorrelationId(), expect.any(_Errors.CallError));
|
|
2565
2641
|
case 17:
|
|
2566
2642
|
case "end":
|
|
2567
|
-
return
|
|
2643
|
+
return _context59.stop();
|
|
2568
2644
|
}
|
|
2569
|
-
},
|
|
2645
|
+
}, _callee59);
|
|
2570
2646
|
})));
|
|
2571
|
-
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2647
|
+
it('Handle blind transfer with undefined transferTarget', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
2572
2648
|
var requestSpy, warnSpy;
|
|
2573
|
-
return _regenerator.default.wrap(function
|
|
2574
|
-
while (1) switch (
|
|
2649
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
2650
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2575
2651
|
case 0:
|
|
2576
2652
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2577
2653
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2578
|
-
|
|
2654
|
+
_context60.next = 4;
|
|
2579
2655
|
return call.completeTransfer(_types5.TransferType.BLIND, undefined, undefined);
|
|
2580
2656
|
case 4:
|
|
2581
2657
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2586,18 +2662,18 @@ describe('Supplementary Services tests', function () {
|
|
|
2586
2662
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2587
2663
|
case 9:
|
|
2588
2664
|
case "end":
|
|
2589
|
-
return
|
|
2665
|
+
return _context60.stop();
|
|
2590
2666
|
}
|
|
2591
|
-
},
|
|
2667
|
+
}, _callee60);
|
|
2592
2668
|
})));
|
|
2593
|
-
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
2669
|
+
it('Handle consult transfer with undefined transferCallId', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61() {
|
|
2594
2670
|
var requestSpy, warnSpy;
|
|
2595
|
-
return _regenerator.default.wrap(function
|
|
2596
|
-
while (1) switch (
|
|
2671
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
2672
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
2597
2673
|
case 0:
|
|
2598
2674
|
requestSpy = jest.spyOn(webex, 'request');
|
|
2599
2675
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
2600
|
-
|
|
2676
|
+
_context61.next = 4;
|
|
2601
2677
|
return call.completeTransfer(_types5.TransferType.CONSULT, undefined, undefined);
|
|
2602
2678
|
case 4:
|
|
2603
2679
|
/* We should be in CALL_ESTABLISHED state */
|
|
@@ -2608,9 +2684,9 @@ describe('Supplementary Services tests', function () {
|
|
|
2608
2684
|
expect(warnSpy).toBeCalledOnceWith("Invalid information received, transfer failed for correlationId: ".concat(call.getCorrelationId()), transferLoggingContext);
|
|
2609
2685
|
case 9:
|
|
2610
2686
|
case "end":
|
|
2611
|
-
return
|
|
2687
|
+
return _context61.stop();
|
|
2612
2688
|
}
|
|
2613
|
-
},
|
|
2689
|
+
}, _callee61);
|
|
2614
2690
|
})));
|
|
2615
2691
|
});
|
|
2616
2692
|
});
|